subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1720015 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Date Mon, 14 Dec 2015 21:11:35 GMT
Author: kotkov
Date: Mon Dec 14 21:11:35 2015
New Revision: 1720015

URL: http://svn.apache.org/viewvc?rev=1720015&view=rev
Log:
Don't leave the *use_log_addressing variable uninitialized when opening
FSFS repositories without db/format files (legacy 1.1-era repositories
didn't have these files).

Uninitialized output variable leads to undefined behavior when accessing it.
In practice, this can result in failing commits, wrong output in svnadmin
info and other feasible problems, since a non-zero value enables the logical
addressing code in a situation where it's not supposed to work:

  > svn mkdir URL
  svn: E200004: Invalid L2P offset in r0 footer

  > svnadmin info
  Path: C:\Repositories\repos
  UUID: fc2931cb-22a3-424d-a79e-62392adb82f0
  Revisions: 0
  Repository Format: 3
  Compatible With Version: 1.1.0
  Filesystem Type: fsfs
  Filesystem Format: 1
  FSFS Sharded: no
  FSFS Logical Addressing: yes   <<<<<<<<<<<
  Configuration File: C:\Repositories\repos\db\fsfs.conf

* subversion/libsvn_fs_fs/fs_fs.c
  (read_format): Initialize *use_log_addressing when handling a filesystem
   without the format file.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1720015&r1=1720014&r2=1720015&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Mon Dec 14 21:11:35 2015
@@ -492,6 +492,7 @@ read_format(int *pformat,
       svn_error_clear(err);
       *pformat = 1;
       *max_files_per_dir = 0;
+      *use_log_addressing = FALSE;
 
       return SVN_NO_ERROR;
     }



Mime
View raw message