summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2001-02-18 01:06:13 +0000
committerbde <bde@FreeBSD.org>2001-02-18 01:06:13 +0000
commit11a6354f43e3c7c8c329dcf77908ced7e9668640 (patch)
tree517f62dd5c19c7c3dd4c403d20c0de774bcbc978 /gnu
parent5136341131f7ada5386553c88ace07200a0e4100 (diff)
downloadFreeBSD-src-11a6354f43e3c7c8c329dcf77908ced7e9668640.zip
FreeBSD-src-11a6354f43e3c7c8c329dcf77908ced7e9668640.tar.gz
Quick fix for attempts to free non-malloc()ed memory. The variables
current_file_name and current_link_name sometimes point into the middle of malloc()ed memory and sometimes point to alloca()ed memory, but free() is sometimes called on them. This seems to be harmless for the usual tar operations, but it is usually fatal for `tar -W'. E.g., for `cd /etc; tar Wcf /tmp/foo rc', at the start of verify_volume(), current_file_name points to alloca()ed memory, and tar attempts to free it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/tar/diffarch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/usr.bin/tar/diffarch.c b/gnu/usr.bin/tar/diffarch.c
index 80e48bc..b1ca591 100644
--- a/gnu/usr.bin/tar/diffarch.c
+++ b/gnu/usr.bin/tar/diffarch.c
@@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public License
along with GNU Tar; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* $FreeBSD$ */
+
/*
* Diff files from a tar archive.
*
@@ -493,6 +495,8 @@ verify_volume ()
int er;
#endif
+ current_file_name = NULL;
+ current_link_name = NULL;
if (!diff_buf)
diff_init ();
#ifdef MTIOCTOP
OpenPOWER on IntegriCloud