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

Re: [PATCH] String creation -- ensuring space for the NUL

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 14 Feb 2012 13:45:53 +0000

Branko Čibej <brane_at_apache.org> writes:

> On 14.02.2012 13:26, Julian Foad wrote:
>> For review, please.
>>
>> We discovered some bugs recently [1,2] with use of svn_string.h functions, where space for the terminating null character was sometimes not being allocated. The attached patch file contains several changes in this area, which are all somewhat together although I'll commit them in two or more separate parts. In summary:
>>
>> * Introduce revved API svn_stringbuf_ensure2() that promises to make space for NUL.
>>
>> * Make the old svn_stringbuf_ensure() provide space for NUL even though it doesn't promise to do so, to help remaining buggy callers to 'just work', since doing so is harmless and it was our inconsistent API that led to the misunderstanding.
>
> Please explain again, why do we need the revved _ensure2 at all? Can you
> think of any possible way that even marginally sane code would break if
> we just fixed the docs and behaviour of _ensure?

I was thinking the same. What would break is somebody reading the new
docs and writing code that fails when linked against existing
svn_stringbuf_ensure.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Received on 2012-02-14 14:46:37 CET

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