tar: do not crash with --listed-incremental

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.
This commit is contained in:
Paul Eggert
2010-09-20 11:34:33 -07:00
parent 4bde4f39d0
commit efe26f98ec

View 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);