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

Re: svn commit: r19803 - in trunk/subversion/bindings/java/javahl: native src/org/tigris/subversion/javahl

From: Blair Zajac <blair_at_orcaware.com>
Date: 2006-05-24 21:07:27 CEST

dlr@tigris.org wrote:
> Author: dlr
> Date: Wed May 24 11:04:16 2006
> New Revision: 19803
>
> Modified:
> trunk/subversion/bindings/java/javahl/native/SVNClient.cpp
> trunk/subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/SVNClientInterface.java
>
> Log:
> Fix a hard JVM crash in JavaHL bindings due to a segfault in the C++
> code which occurs when a null value is passed from Java-land into the
> SVNClient.username() or SVNClient.password() method.
>
> Gory details: The JNI C code (the glue between Java and C++) creates a
> JNIStringHolder object, which is implicitly cast to a const char *
> when invoking the SVNClient::username() or password() method, which
> implicitly invokes a std::string constructor which accepts a const
> char * parameter during an "=" assignment, which ends up trying to do
> a string length calculation on a NULL value. Boom!

Would it be a good idea to put this comment and the knowledge into the code
itself also, so that somebody who comes along and looks at it wonders why it's
done the way it is?

Regards,
Blair

-- 
Blair Zajac, Ph.D.
<blair@orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 24 21:07:57 2006

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.