You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2015/12/01 17:19:35 UTC

svn commit: r1717453 - /subversion/trunk/subversion/libsvn_fs_x/revprops.c

Author: stefan2
Date: Tue Dec  1 16:19:35 2015
New Revision: 1717453

URL: http://svn.apache.org/viewvc?rev=1717453&view=rev
Log:
Follow-up to r1717438: Make sure the revprop contents always remains valid
as long as the props hash itself.

Reported by: philipm

* subversion/libsvn_fs_x/revprops.c
  (read_non_packed_revprop): Copy the contents string into the result pool
                             before building the props hash upon it.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/revprops.c

Modified: subversion/trunk/subversion/libsvn_fs_x/revprops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/revprops.c?rev=1717453&r1=1717452&r2=1717453&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/revprops.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/revprops.c Tue Dec  1 16:19:35 2015
@@ -466,9 +466,14 @@ read_non_packed_revprop(apr_hash_t **pro
     }
 
   if (content)
-    SVN_ERR(parse_revprop(properties, fs, rev,
-                          svn_stringbuf__morph_into_string(content),
-                          result_pool, iterpool));
+    {
+      /* The contents string becomes part of the *PROPERTIES structure, i.e.
+       * we must make sure it lives at least as long as the latter. */
+      svn_string_t *as_string = svn_string_create_from_buf(content,
+                                                           result_pool);
+      SVN_ERR(parse_revprop(properties, fs, rev, as_string,
+                            result_pool, iterpool));
+    }
 
   svn_pool_clear(iterpool);