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

Re: svn commit: r22689 - trunk/subversion/libsvn_subr

From: Daniel Rall <dlr_at_collab.net>
Date: 2006-12-13 22:47:08 CET

Aiiiiiieee. Backport to 1.4.x and 1.3.x, I take it?

On Wed, 13 Dec 2006, dionisos@tigris.org wrote:

> Author: dionisos
> Date: Wed Dec 13 13:39:19 2006
> New Revision: 22689
>
> Log:
> Fix off-by-1 error.
>
> * subversion/libsvn_subr/svn_string.c
> (svn_stringbuf_ensure): Be sure to copy the trailing
> - but like strlen() uncounted - nul character into the new data block.
>
>
> Modified:
> trunk/subversion/libsvn_subr/svn_string.c
>
> Modified: trunk/subversion/libsvn_subr/svn_string.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_subr/svn_string.c?pathrev=22689&r1=22688&r2=22689
> ==============================================================================
> --- trunk/subversion/libsvn_subr/svn_string.c (original)
> +++ trunk/subversion/libsvn_subr/svn_string.c Wed Dec 13 13:39:19 2006
> @@ -356,10 +356,12 @@
> }
> }
>
> - str->data = (char *) my__realloc(str->data,
> - str->len,
> + str->data = (char *) my__realloc(str->data,
> + str->len + 1,
> + /* We need to maintain (and thus copy)
> + the trailing nul */
> str->blocksize,
> - str->pool);
> + str->pool);
> }
> }

  • application/pgp-signature attachment: stored
Received on Wed Dec 13 23:09:05 2006

This is an archived mail posted to the Subversion Dev mailing list.