]> Dogcows Code - chaz/tar/commitdiff
tar: do not crash with --listed-incremental
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 Sep 2010 18:34:33 +0000 (11:34 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 Sep 2010 18:35:04 +0000 (11:35 -0700)
Problem reported by Frantisek Hanzlik in
<https://bugzilla.redhat.com/635318> via Kamil Dudka in
<http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html>.
I don't understand this code either, but Sergey can take a look at
this patch, and perhaps install a better one, when he has the time.
* src/incremen.c (append_incremental_renames): Don't actually append
anything to DIR if DIR is null.

src/incremen.c

index c6d4f4c5849a2ecdb5e9633a36e718c95e195f93..4d86ed791c88d57b40e4a7fe705f4d711eb85b1a 100644 (file)
@@ -890,7 +890,8 @@ append_incremental_renames (struct directory *dir)
   for (dp = dirhead; dp; dp = dp->next)
     store_rename (dp, &stk);
 
-  if (obstack_object_size (&stk) != size)
+  /* FIXME: Is this the right thing to do when DIR is null?  */
+  if (dir && obstack_object_size (&stk) != size)
     {
       obstack_1grow (&stk, 0);
       dumpdir_free (dir->dump);
This page took 0.02429 seconds and 4 git commands to generate.