bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] [PATCH] tar: do not crash with --listed-incremental


From: Paul Eggert
Subject: Re: [Bug-tar] [PATCH] tar: do not crash with --listed-incremental
Date: Mon, 20 Sep 2010 11:37:18 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8

On 09/20/10 00:49, Kamil Dudka wrote:

> I must admit I don't understand much the code, but the attached patch at 
> least 
> solves the reported crash.  Thanks in advance for review!

Thanks, I installed the following (slightly different) patch.
Sergey needs to take a look at this one for the "right" patch;
this is just a workaround.

>From 8898730722d2dc30d4d1ba9104515004f0adbfed Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Mon, 20 Sep 2010 11:34:33 -0700
Subject: [PATCH] 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.
---
 src/incremen.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]