Author: philip
Date: Fri Jul 26 15:11:35 2013
New Revision: 1507347

URL: http://svn.apache.org/r1507347
Log:
* subversion/libsvn_fs_fs/low_level.c
  (svn_fs_fs__parse_representation): Handle leading underscore when
   parsing the uniquifier, check the whole uniquifier is parsed.

Modified:
    subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c

Modified: 
subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c?rev=1507347&r1=1507346&r2=1507347&view=diff
==============================================================================
--- subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c 
(original)
+++ subversion/branches/fsfs-improvements/subversion/libsvn_fs_fs/low_level.c 
Fri Jul 26 15:11:35 2013
@@ -524,6 +524,7 @@ svn_fs_fs__parse_representation(represen
   apr_int64_t val;
   char *string = text->data;
   svn_checksum_t *checksum;
+  const char *end;
 
   rep = apr_pcalloc(pool, sizeof(*rep));
   *rep_p = rep;
@@ -600,11 +601,16 @@ svn_fs_fs__parse_representation(represen
   SVN_ERR(svn_fs_fs__id_txn_parse(&rep->uniquifier.txn_id, str));
 
   str = svn_cstring_tokenize(" ", &string);
-  if (str == NULL)
+  if (str == NULL || *str != '_')
     return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
                             _("Malformed text representation offset line in 
node-rev"));
 
-  rep->uniquifier.number = svn__base36toui64(NULL, str);
+  ++str;
+  rep->uniquifier.number = svn__base36toui64(&end, str);
+
+  if (*end)
+    return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
+                            _("Malformed text representation offset line in 
node-rev"));
 
   return SVN_NO_ERROR;
 }


Reply via email to