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 2017/02/03 08:50:33 UTC

svn commit: r1781507 - /subversion/trunk/subversion/libsvn_repos/dump.c

Author: stsp
Date: Fri Feb  3 08:50:33 2017
New Revision: 1781507

URL: http://svn.apache.org/viewvc?rev=1781507&view=rev
Log:
Fix a NULL deref in libsvn_repos which makes svndumpfilter crash.

* subversion/libsvn_repos/dump.c
  (svn_repos__dump_revision_record): Don't try to print a Content-length
   header if propstring is NULL.
  
Reported by: Steven Barbaglia
https://svn.haxx.se/users/archive-2017-02/0012.shtml

Modified:
    subversion/trunk/subversion/libsvn_repos/dump.c

Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1781507&r1=1781506&r2=1781507&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Fri Feb  3 08:50:33 2017
@@ -546,11 +546,15 @@ svn_repos__dump_revision_record(svn_stre
                                  "%" APR_SIZE_T_FMT, propstring->len));
     }
 
-  /* Write out a regular Content-length header for the benefit of
-     non-Subversion RFC-822 parsers. */
-  svn_hash_sets(headers, SVN_REPOS_DUMPFILE_CONTENT_LENGTH,
-                apr_psprintf(scratch_pool,
-                             "%" APR_SIZE_T_FMT, propstring->len));
+  if (propstring)
+    {
+      /* Write out a regular Content-length header for the benefit of
+         non-Subversion RFC-822 parsers. */
+      svn_hash_sets(headers, SVN_REPOS_DUMPFILE_CONTENT_LENGTH,
+                    apr_psprintf(scratch_pool,
+                                 "%" APR_SIZE_T_FMT, propstring->len));
+    }
+
   SVN_ERR(write_revision_headers(dump_stream, headers, scratch_pool));
 
   /* End of headers */