From efe26f98ec84856025f56673639d6bd520aa2e64 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 20 Sep 2010 11:34:33 -0700 Subject: [PATCH] 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. --- src/incremen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.45.2