Author: julianfoad
Date: Wed Nov 22 17:00:22 2017
New Revision: 1816069

URL: http://svn.apache.org/viewvc?rev=1816069&view=rev
Log:
On the '1.8.x' branch: Fix #4707: svnrdump dump: 2GB limit on content-length 
header

On platforms where 'long' is 32 bits, such as at least some versions of
Windows, svnrdump printed bad headers for file-representations more than 2GB
in length, up to version 1.8.19.

Attempting to load such a dump file gave this error: "svnadmin: E140001: Sum
of subblock sizes larger than total block content length".

This code was refactored before version 1.9.0 such that the bug was no
longer present.

Found by: Ronald Taneza <ronald.taneza{_AT_}gmail.com>

* subversion/svnrdump/dump_editor.c
  (close_file): Print lengths using APR_SIZE_T_FMT instead of 'long'.

Modified:
    subversion/branches/1.8.x-issue4707/subversion/svnrdump/dump_editor.c

Modified: subversion/branches/1.8.x-issue4707/subversion/svnrdump/dump_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x-issue4707/subversion/svnrdump/dump_editor.c?rev=1816069&r1=1816068&r2=1816069&view=diff
==============================================================================
--- subversion/branches/1.8.x-issue4707/subversion/svnrdump/dump_editor.c 
(original)
+++ subversion/branches/1.8.x-issue4707/subversion/svnrdump/dump_editor.c Wed 
Nov 22 17:00:22 2017
@@ -1040,8 +1040,8 @@ close_file(void *file_baton,
       /* Text-content-length: 39 */
       SVN_ERR(svn_stream_printf(eb->stream, pool,
                                 SVN_REPOS_DUMPFILE_TEXT_CONTENT_LENGTH
-                                ": %lu\n",
-                                (unsigned long)info->size));
+                                ": %" APR_SIZE_T_FMT "\n",
+                                info->size));
 
       /* Text-content-md5: 82705804337e04dcd0e586bfa2389a7f */
       SVN_ERR(svn_stream_printf(eb->stream, pool,
@@ -1055,13 +1055,13 @@ close_file(void *file_baton,
   if (fb->dump_props)
     SVN_ERR(svn_stream_printf(eb->stream, pool,
                               SVN_REPOS_DUMPFILE_CONTENT_LENGTH
-                              ": %ld\n\n",
-                              (unsigned long)info->size + propstring->len));
+                              ": %" APR_SIZE_T_FMT "\n\n",
+                              info->size + propstring->len));
   else if (fb->dump_text)
     SVN_ERR(svn_stream_printf(eb->stream, pool,
                               SVN_REPOS_DUMPFILE_CONTENT_LENGTH
-                              ": %ld\n\n",
-                              (unsigned long)info->size));
+                              ": %" APR_SIZE_T_FMT "\n\n",
+                              info->size));
 
   /* Dump the props now */
   if (fb->dump_props)


Reply via email to