[sheepdog] [PATCH] farm: fix comparison of empty sha1

Liu Yuan namei.unix at gmail.com
Wed Aug 8 06:45:13 CEST 2012


On 08/07/2012 08:49 PM, MORITA Kazutaka wrote:
> I've not ever met any problems yet.  I just noticed that the usage of
> strlen is wrong.
> 
> I think the old code doesn't cause fatal problems like segfault, but
> causes a redundant write to the farm backend store when the sha1 value
> starts with zero.

I guess you might be confused of '\0' against '0', I don't think there
is any problem to check sha1 *string* by strlen(). I think the patch
will cost extra cycles than old one also.

Thanks,
Yuan



More information about the sheepdog mailing list