[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

JNIUtil.cpp:583: dangling pointer ?

From: David Binderman <dcb314_at_hotmail.com>
Date: Fri, 8 May 2015 09:52:38 +0000

Hello there,

[subversion-1.9.0-beta1/subversion/bindings/javahl/native/JNIUtil.cpp:583]: (error) Dangerous usage of c_str(). The value returned by c_str() is invalid after this call.

#ifdef SVN_DEBUG
#ifndef SVN_ERR__TRACING
  if (err->file)
    {
      std::ostringstream buf;
      buf << err->file;
      if (err->line> 0)
        buf << ':' << err->line;
      source = buf.str().c_str();
    }
#endif
#endif

Luckily, it's only debug code, but you might want to fix it anyway.

Regards

David Binderman

                                               
Received on 2015-05-08 11:52:51 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.