You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/10/27 12:33:46 UTC

svn commit: r1027899 - /subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Author: julianfoad
Date: Wed Oct 27 10:33:46 2010
New Revision: 1027899

URL: http://svn.apache.org/viewvc?rev=1027899&view=rev
Log:
* subversion/tests/libsvn_wc/op-depth-test.c
  (compare_nodes_rows): Avoid a seg-fault by adjusting the 'actual' row
    only if there *is* an 'actual' row.

Found by: philipm

Modified:
    subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c

Modified: subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c?rev=1027899&r1=1027898&r2=1027899&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/op-depth-test.c Wed Oct 27 10:33:46 2010
@@ -290,26 +290,27 @@ compare_nodes_rows(const void *key, apr_
    * any such lack of elision, for the purposes of these tests, because the
    * method of copying in use (at the time this tweak is introduced) does
    * calculate these values itself, it simply copies from the source rows. */
-  {
-    const char *parent_relpath, *name, *parent_key;
-    nodes_row_t *parent_actual;
+  if (actual)
+    {
+      const char *parent_relpath, *name, *parent_key;
+      nodes_row_t *parent_actual;
 
-    svn_relpath_split(&parent_relpath, &name, actual->local_relpath,
-                      b->scratch_pool);
-    parent_key = apr_psprintf(b->scratch_pool, "%d %s",
-                              actual->op_depth, parent_relpath);
-    parent_actual = apr_hash_get(b->actual_hash, parent_key,
-                                 APR_HASH_KEY_STRING);
-    if (parent_actual
-        && strcmp(actual->repo_relpath,
-                  svn_relpath_join(parent_actual->repo_relpath, name,
-                                   b->scratch_pool)) == 0
-        && actual->repo_revnum == parent_actual->repo_revnum)
-      {
-        actual->repo_relpath = NULL;
-        actual->repo_revnum = SVN_INVALID_REVNUM;
-      }
-  }
+      svn_relpath_split(&parent_relpath, &name, actual->local_relpath,
+                        b->scratch_pool);
+      parent_key = apr_psprintf(b->scratch_pool, "%d %s",
+                                actual->op_depth, parent_relpath);
+      parent_actual = apr_hash_get(b->actual_hash, parent_key,
+                                   APR_HASH_KEY_STRING);
+      if (parent_actual
+          && strcmp(actual->repo_relpath,
+                    svn_relpath_join(parent_actual->repo_relpath, name,
+                                     b->scratch_pool)) == 0
+          && actual->repo_revnum == parent_actual->repo_revnum)
+        {
+          actual->repo_relpath = NULL;
+          actual->repo_revnum = SVN_INVALID_REVNUM;
+        }
+    }
 #endif
 
   if (! expected)