Re: valgrind UMRs in "svn merge --record-only"

Martin Furter <[email protected]> Mon, 30 Nov 2009 18:26:09 +0100 (CET)
Newsgroups gmane.comp.version-control.subversion.devel,gmane.comp.version-control.subversion.rapidsvn.devel
Message-ID <[email protected]>
On Mon, 30 Nov 2009, Philip Martin wrote:

> I'm seeing an unitialised memory read during "svn merge --record-only"
> in places like blame_tests.py 10.  This happens when
> libsvn_client/repos_diff.c:add_directory calls
> libsvn_client/merge.c:merge_dir_added which does:
>
>  /* Easy out: We are only applying mergeinfo changes to existing paths. */
>  if (merge_b->record_only)
>    {
>      svn_pool_destroy(subpool);
>      return SVN_NO_ERROR;
>    }
>
> without setting *state so when add_directory then goes on the check
> state it triggers the UMR.  One fix would be soemthing like:
>
> Index: subversion/libsvn_client/merge.c
> ===================================================================
> --- subversion/libsvn_client/merge.c	(revision 885260)
> +++ subversion/libsvn_client/merge.c	(working copy)
> @@ -2003,6 +2003,8 @@
>   /* Easy out: We are only applying mergeinfo changes to existing paths. */
>   if (merge_b->record_only)
>     {
> +      if (*state)
> +        *state = svn_wc_notify_state_unknown;
>       svn_pool_destroy(subpool);
>       return SVN_NO_ERROR;
>     }

I assume you wanted to write (as the rest of the code does):
   +      if (state)

And the documentation doesn't indicate that state may be NULL. Is that a 
documentation bug?

Martin

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2425588

Please start new threads on the <[email protected]> mailing list.
To subscribe to the new list, send an empty e-mail to <[email protected]>.