Hi Sergey,

> Just treat warnings as warnings :) Or apply the following patch, which
> I have just pushed to the repository.

thanks, I was able to recompile it - but I wanted exactly that ^^^ push
from you.  Thanks a lot for your work.

I'm looking at the patch once again.  Basically, I like the idea you
implemented.  But I'm unable to backport to Fedora such big change without
a risk :(.  (Ahm, the release cycle of GNU tar is so long.. and
distributions need non-risky back-patching).

-----

Something from my review:  I see at least two problems there.

- there is one uninitialized variable, patch attached

- the semantics of -T option changed in relation to -C option.  I am
  unable to find any note in changelog that this is expected - so I'm just
  not sure.  Do you really want that?  I know that the -T FILE's content
  is handled relatively to "current" directory.  Thus it is probably more
  consistent to try to find FILE also relatively, but... if I'm thinking
  as user, I don't like specifying the files relatively to current cwd.
  (I can cooperate on fix if you don't have enough time to look at it)

Pavel
>From c4d5c14d5cc247db9016000f7832c81c4f0707c7 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <prais...@redhat.com>
Date: Thu, 15 Aug 2013 11:43:17 +0200
Subject: [PATCH] tar: fix use of uninitialized memory

This complements 26538c9bf.

* src/names.c (name_add_file): Initialize the ep->v.file.fp pointer
  after structure allocation.
* tests/testsuite.at: Export MALLOC_PERTURB_ environmental variables for
  whole testsuite.  This should avoid bugs like this.  For platforms not
  supporting that it should be innocent, but lets see what will happen.
---
 src/names.c        | 1 +
 tests/testsuite.at | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/names.c b/src/names.c
index f3a3536..c8e2f03 100644
--- a/src/names.c
+++ b/src/names.c
@@ -291,6 +291,7 @@ name_add_file (const char *name, int term)
   ep->type = NELT_FILE;
   ep->v.file.name = name;
   ep->v.file.term = term;
+  ep->v.file.fp = NULL; /* not opened yet */
 }
 
 /* Names from external name file.  */
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 605cca3..7721b5b 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -33,6 +33,7 @@ TEST_TAR_FORMAT=FMT
 export TEST_TAR_FORMAT
 TAR_OPTIONS="-H FMT"
 export TAR_OPTIONS
+export MALLOC_PERTURB_=170
 rm -rf *
 $1)],$2,$3,$4,$5,$6)
               AT_TAR_CHECK_HOOK])
-- 
1.8.3.1

Reply via email to