You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@red-bean.com> on 2008/08/27 18:45:59 UTC

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

hwright@tigris.org writes:
> 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.

Don't forget to document this as part of the API, then.

-Karl

> Modified:
>    trunk/subversion/libsvn_subr/checksum.c
>
> Modified: trunk/subversion/libsvn_subr/checksum.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_subr/checksum.c?pathrev=32702&r1=32701&r2=32702
> ==============================================================================
> --- trunk/subversion/libsvn_subr/checksum.c	Mon Aug 25 10:29:53 2008	(r32701)
> +++ trunk/subversion/libsvn_subr/checksum.c	Mon Aug 25 11:46:31 2008	(r32702)
> @@ -137,6 +137,12 @@ svn_checksum_parse_hex(svn_checksum_t **
>    int len;
>    int i;
>  
> +  if (hex == NULL)
> +    {
> +      *checksum = NULL;
> +      return SVN_NO_ERROR;
> +    }
> +
>    SVN_ERR(validate_kind(kind));
>  
>    *checksum = svn_checksum_create(kind, pool);
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org