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

Re: Coredump when javahl SVNClient::diff() called with diff-cmd set

From: Branko Čibej <brane_at_apache.org>
Date: Thu, 25 Oct 2018 13:18:51 +0200

On 25.10.2018 12:41, BURT, Matthew J wrote:
>
> Hi,
>
>  
>
> We’ve got a number of developers using the javahl bindings from Eclipse
>
> via subclipse.
>
>  
>
> One of them recently reported a coredump against 1.10.3. I’ve also
>
> reproduced it with 1.9.7.
>
>  
>
> The problem occurs when SVNClient::diff() is called with a diff-cmd
>
> defined in the user’s ~/.subversion/config file.
>
>  
>
> SVNClient::diff() calls svn_client_diff6() with the errstream explicitly
>
> set to NULL and the diff command in dwi->diff_cmd.
>
>  
>
> Further down in the code, if diff_content_changed() from
>
> subversion/libsvn_client/diff.c is called, the NULL errstream is
>
> de-referenced with a call to svn_stream__aprfile().
>
>  
>
> I’ve put together a simple patch to avoid the null dereference, but I’m
>
> not 100% sure this is the correct solution. The code suggests to me that
>
> the intention is to allow the errstream parameter for svn_client_diff6()
>
> to be set to NULL, but maybe I’m misreading it.
>
>  
>
> Is this the correct approach, and should I submit this patch for
>
> consideration?
>

The docstring for svn_client_diff7 (..._diff6 was deprecated on trunk)
doesn't say that outstream or errstream may be NULL; that's pretty
definitive. This should be fixed in the native JavaHL code; either an
actual stream should be used such that JavaHL users can read it (in this
case I suspect that the JavaHL API would have to be upgraded), or a
stream that ignores all writes should be used.

-- Brane
Received on 2018-10-25 13:19:00 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.