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/01/27 11:59:22 UTC

svn commit: r1655007 - /subversion/branches/pin-externals/subversion/libsvn_client/copy.c

Author: stsp
Date: Tue Jan 27 10:59:22 2015
New Revision: 1655007

URL: http://svn.apache.org/r1655007
Log:
On the pin-externals branch, fix a potential segfault.

* subversion/libsvn_client/copy.c
  (resolve_pinned_externals): Always allocate the result hash table to
   avoid returning an invalid pointer if exiting early.

Modified:
    subversion/branches/pin-externals/subversion/libsvn_client/copy.c

Modified: subversion/branches/pin-externals/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/pin-externals/subversion/libsvn_client/copy.c?rev=1655007&r1=1655006&r2=1655007&view=diff
==============================================================================
--- subversion/branches/pin-externals/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/pin-externals/subversion/libsvn_client/copy.c Tue Jan 27 10:59:22 2015
@@ -394,6 +394,8 @@ resolve_pinned_externals(apr_hash_t **ne
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
 
+  *new_externals = apr_hash_make(result_pool);
+
   if (svn_path_is_url(pair->src_abspath_or_url))
     {
       SVN_ERR(svn_client__ensure_ra_session_url(&old_url, ra_session,
@@ -439,7 +441,6 @@ resolve_pinned_externals(apr_hash_t **ne
       return SVN_NO_ERROR;
     }
   
-  *new_externals = apr_hash_make(result_pool);
   iterpool = svn_pool_create(scratch_pool);
   for (hi = apr_hash_first(scratch_pool, externals_props);
        hi;