subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1678846 - /subversion/trunk/subversion/libsvn_subr/checksum.c
Date Tue, 12 May 2015 00:42:35 GMT
Author: danielsh
Date: Tue May 12 00:42:35 2015
New Revision: 1678846

URL: http://svn.apache.org/r1678846
Log:
* subversion/libsvn_subr/checksum.c
  (svn_checksum_deserialize): Change an assertion to an error.

Modified:
    subversion/trunk/subversion/libsvn_subr/checksum.c

Modified: subversion/trunk/subversion/libsvn_subr/checksum.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/checksum.c?rev=1678846&r1=1678845&r2=1678846&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/checksum.c (original)
+++ subversion/trunk/subversion/libsvn_subr/checksum.c Tue May 12 00:42:35 2015
@@ -347,7 +347,10 @@ svn_checksum_deserialize(const svn_check
   apr_size_t prefix_len = strlen(ckind_str[0]);
 
   /* "$md5 $...", "$sha1$..." or ... */
-  SVN_ERR_ASSERT(strlen(data) > prefix_len);
+  if (strlen(data) <= prefix_len)
+    return svn_error_createf(SVN_ERR_BAD_CHECKSUM_PARSE, NULL,
+                             _("Invalid prefix in checksum '%s'"),
+                             data);
 
   for (kind = svn_checksum_md5; kind <= svn_checksum_fnv1a_32x4; ++kind)
     if (strncmp(ckind_str[kind], data, prefix_len) == 0)



Mime
View raw message