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

Re: svn_client_copy4 crashes when caller doesn't want commit info (was: Re: svn commit: r23219 - trunk/subversion/libsvn_client)

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-08-13 17:13:11 CEST

David James wrote:
> On 1/24/07, hwright@tigris.org <hwright@tigris.org> wrote:
>> * subversion/libsvn_client/copy.c
>> (svn_client_copy4, svn_client_move5): Use a subpool for calls to
>> setup_copy(). Copy *commit_info_p into the main pool before destroying the
>> subpool.
>
> Hi Hyrum,
>
> In r23219 and friends, you changed svn_client_copy4 and
> svn_client_move5 so that it unconditionally sets *commit_info_p. This
> causes these functions to segfault if the user set commit_info_p to
> NULL so as to indicate that they don't want commit info (e.g., because
> they are doing a WC-to-WC copy, where no commit is occurring).
>
> The API docs for svn_client_move5 don't say explicitly whether users
> are allowed to pass NULL for commit_info_p is allowed, but in the
> ctypes Python bindings we assumed that this is allowed and it worked
> fine with Subversion 1.4 for wc to wc copies.
>
> I think it would be a good idea to patch svn_client_copy4,
> svn_client_move5, and their documentation to explicitly allow passing
> NULL, both for the sake of compatibility and API convenience.

Good suggestion. NULL should be a valid input for commit_info_p.
r26052 checks for that condition before setting *commit_info_p inside of
svn_client_moe5() and svn_client_copy4(). Would you like to update the
documentation to be more explicit?

-Hyrum

Received on Mon Aug 13 17:11:49 2007

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.