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

subversion-1.10.2/subversion/bindings/javahl/native/JNIUtil.cpp:589: pointer to dead memory ?

From: David Binderman <dcb314_at_hotmail.com>
Date: Sun, 22 Jul 2018 10:17:24 +0000

Hello there,

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

Source code is

    {
      std::ostringstream buf;
      buf << err->file;
      if (err->line > 0)
        buf << ':' << err->line;
      source = buf.str().c_str();
    }

source seems to be left pointing at some random stack address.

Regards

David Binderman
Received on 2018-07-22 18:27:26 CEST

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

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