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

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

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: Fri, 29 Aug 2008 13:13:53 -0500

Blair Zajac wrote:
> Philip Martin wrote:
>> hwright_at_tigris.org writes:
>>
>>> Author: hwright
>>> Date: Mon Aug 25 11:46:31 2008
>>> New Revision: 32702
>>>
>>> Log:
>>> If parsing a NULL pointer into a checksum, don't crash, but just
>>> return a
>>> NULL checksum instead.
>>>
>>> * subversion/libsvn_subr/checksum.c
>>> (svn_checksum_parse_hex): If given NULL hex, return a NULL checksum.
>>>
>>> Modified:
>>> trunk/subversion/libsvn_subr/checksum.c
>>
>> Strange thing to support in my view. If it is going to behave this
>> way it needs to be documented in the header at the very least, even
>> better would be a regression test. Giving the code undocumented
>> "magic" behaviour is a bad idea.
>
> Wouldn't it be better to have SVN_ASSERT(hex != NULL) for the hex
> argument then allow a NULL string return a NULL checksum? This sounds
> like its opening up to easier bugs

I don't think so. The NULL checksum is a perfectly valid checksum, and we've
documented so in other places. Amending the docstring to this function would be
useful though, and I've done so in r32818.

-Hyrum

Received on 2008-08-29 20:14:12 CEST

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.