From: Paul Eggert Date: Mon, 20 Sep 2010 18:34:33 +0000 (-0700) Subject: tar: do not crash with --listed-incremental X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=efe26f98ec84856025f56673639d6bd520aa2e64;p=chaz%2Ftar tar: do not crash with --listed-incremental Problem reported by Frantisek Hanzlik in via Kamil Dudka in . 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. --- diff --git a/src/incremen.c b/src/incremen.c index c6d4f4c..4d86ed7 100644 --- a/src/incremen.c +++ b/src/incremen.c @@ -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);