[
https://issues.apache.org/jira/browse/SVN-4764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16552129#comment-16552129
]
Branko Čibej commented on SVN-4764:
-----------------------------------
Confirmed; what's worse, we've had this code in JavaHL since before the move to
the ASF. The onlty reason we probably didn't see crashes here is that it's
likely to be disabled in most builds.
> subversion-1.10.2/subversion/bindings/javahl/native/JNIUtil.cpp:589]: (error)
> Dangerous usage of c_str()
> --------------------------------------------------------------------------------------------------------
>
> Key: SVN-4764
> URL: https://issues.apache.org/jira/browse/SVN-4764
> Project: Subversion
> Issue Type: Bug
> Components: bindings_javahl
> Reporter: David Binderman
> Assignee: Branko Čibej
> Priority: Minor
>
> 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 is left pointing at a random stack location.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)