subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hwri...@apache.org
Subject svn commit: r1135054 - /subversion/trunk/subversion/libsvn_repos/dump.c
Date Mon, 13 Jun 2011 08:02:55 GMT
Author: hwright
Date: Mon Jun 13 08:02:54 2011
New Revision: 1135054

URL: http://svn.apache.org/viewvc?rev=1135054&view=rev
Log:
Fix crashes on 'svnadmin dump' by ensuring we have an error before we
attempt to use it for warning or verification.

* subversion/libsvn_repos/dump.c
  (dump_node): Only attempt to warn or verify if we actually have an error.

Modified:
    subversion/trunk/subversion/libsvn_repos/dump.c

Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1135054&r1=1135053&r2=1135054&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Mon Jun 13 08:02:54 2011
@@ -248,27 +248,30 @@ dump_node(struct edit_baton *eb,
     {
       svn_error_t *err = svn_fs__path_valid(path, pool);
 
-      if (eb->notify_func)
+      if (err)
         {
-          char errbuf[512]; /* ### svn_strerror() magic number  */
-          svn_repos_notify_t *notify;
-          notify = svn_repos_notify_create(svn_repos_notify_warning, pool);
-
-          notify->warning = svn_repos_notify_warning_invalid_fspath;
-          notify->warning_str = apr_psprintf(
-                 pool,
-                 _("E%06d: While validating fspath '%s': %s"),
-                 err->apr_err, path,
-                 svn_err_best_message(err, errbuf, sizeof(errbuf)));
+          if (eb->notify_func)
+            {
+              char errbuf[512]; /* ### svn_strerror() magic number  */
+              svn_repos_notify_t *notify;
+              notify = svn_repos_notify_create(svn_repos_notify_warning, pool);
 
-          eb->notify_func(eb->notify_baton, notify, pool);
-        }
+              notify->warning = svn_repos_notify_warning_invalid_fspath;
+              notify->warning_str = apr_psprintf(
+                     pool,
+                     _("E%06d: While validating fspath '%s': %s"),
+                     err->apr_err, path,
+                     svn_err_best_message(err, errbuf, sizeof(errbuf)));
 
-      /* Return the error in addition to notifying about it. */
-      if (eb->verify)
-        return svn_error_return(err);
-      else
-        svn_error_clear(err);
+              eb->notify_func(eb->notify_baton, notify, pool);
+            }
+
+          /* Return the error in addition to notifying about it. */
+          if (eb->verify)
+            return svn_error_return(err);
+          else
+            svn_error_clear(err);
+        }
     }
 
   /* Write out metadata headers for this file node. */



Mime
View raw message