You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/09/10 13:21:47 UTC

svn commit: r1702218 - /subversion/trunk/subversion/libsvn_client/upgrade.c

Author: ivan
Date: Thu Sep 10 11:21:46 2015
New Revision: 1702218

URL: http://svn.apache.org/r1702218
Log:
Fix segfault in 'svn upgrade' of pre-Subversion 1.3 working copies with
externals.

Found by: TortoiseSVN crash dump

* subversion/libsvn_client/upgrade.c
  (upgrade_externals_from_properties): Accept INFO_BATON as argument instead
   of using uninitialized variable. 
  (svn_client_upgrade): Pass INFO_BATON to
   upgrade_externals_from_properties().

Modified:
    subversion/trunk/subversion/libsvn_client/upgrade.c

Modified: subversion/trunk/subversion/libsvn_client/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/upgrade.c?rev=1702218&r1=1702217&r2=1702218&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/upgrade.c (original)
+++ subversion/trunk/subversion/libsvn_client/upgrade.c Thu Sep 10 11:21:46 2015
@@ -83,11 +83,13 @@ fetch_repos_info(const char **repos_root
 }
 
 /* Forward definition. Upgrades svn:externals properties in the working copy
-   LOCAL_ABSPATH to the WC-NG  storage.
+   LOCAL_ABSPATH to the WC-NG  storage. INFO_BATON will be used to fetch
+   repository info using fetch_repos_info() function if needed.
  */
 static svn_error_t *
 upgrade_externals_from_properties(svn_client_ctx_t *ctx,
                                   const char *local_abspath,
+                                  struct repos_info_baton *info_baton,
                                   apr_pool_t *scratch_pool);
 
 svn_error_t *
@@ -172,7 +174,7 @@ svn_client_upgrade(const char *path,
          (There is no way to detect the difference from libsvn_client :( ) */
 
       SVN_ERR(upgrade_externals_from_properties(ctx, local_abspath,
-                                                scratch_pool));
+                                                &info_baton, scratch_pool));
     }
   return SVN_NO_ERROR;
 }
@@ -180,6 +182,7 @@ svn_client_upgrade(const char *path,
 static svn_error_t *
 upgrade_externals_from_properties(svn_client_ctx_t *ctx,
                                   const char *local_abspath,
+                                  struct repos_info_baton *info_baton,
                                   apr_pool_t *scratch_pool)
 {
   apr_hash_index_t *hi;
@@ -187,7 +190,6 @@ upgrade_externals_from_properties(svn_cl
   apr_pool_t *iterpool2;
   apr_hash_t *externals;
   svn_opt_revision_t rev = {svn_opt_revision_unspecified, {0}};
-  struct repos_info_baton info_baton;
 
   /* Now it's time to upgrade the externals too. We do it after the wc
      upgrade to avoid that errors in the externals causes the wc upgrade to
@@ -345,7 +347,7 @@ upgrade_externals_from_properties(svn_cl
             {
               err = fetch_repos_info(&repos_root_url,
                                      &repos_uuid,
-                                     &info_baton,
+                                     info_baton,
                                      resolved_url,
                                      scratch_pool, scratch_pool);
               if (err)