Author: stsp
Date: Tue Feb 19 12:19:35 2013
New Revision: 1447695

URL: http://svn.apache.org/r1447695
Log:
* subversion/libsvn_wc/wc_db_update_move.c
  (get_tc_info): Cope with NULL version information stored in a tree conflict.
   I am not sure if such conflicts are valid in first place, but raising an
   error is better than crashing, in any case.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c

Modified: subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c?rev=1447695&r1=1447694&r2=1447695&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db_update_move.c Tue Feb 19 
12:19:35 2013
@@ -1348,11 +1348,25 @@ get_tc_info(svn_wc_operation_t *operatio
   if (locations)
     {
       SVN_ERR_ASSERT(locations->nelts >= 2);
+
+      /* This might set {old,new}_version to NULL. */
       *old_version = APR_ARRAY_IDX(locations, 0,
-                                     svn_wc_conflict_version_t *);
+                                   svn_wc_conflict_version_t *);
       *new_version = APR_ARRAY_IDX(locations, 1,
                                    svn_wc_conflict_version_t *);
     }
+  else
+    {
+      *old_version = NULL;
+      *new_version = NULL;
+    }
+
+  /* The update-move editor relies on version information being available. */
+  if (*old_version == NULL || *new_version == NULL)
+    return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+                             _("'%s' has no conflict version information"),
+                             svn_dirent_local_style(src_abspath,
+                                                    scratch_pool));
 
   SVN_ERR(svn_wc__conflict_read_tree_conflict(local_change,
                                               incoming_change,


Reply via email to