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