Article View: gnu.utils.bug
Article #891tar-1.11
From: System Account
Date: Sat, 10 Oct 1992 18:22
Date: Sat, 10 Oct 1992 18:22
40 lines
1894 bytes
1894 bytes
In 'extract.c', line 351 should be
namelen = strlen(skipcrud + current_file_name) + 1;
^^^
since we should allocate space for and copy the null terminator
at the end of the string in the bcopy call.
Also, in 'extract.c', line 604 should be
namelen = strlen(current_file_name + skipcrud) - 1;
instead of
namelen = strlen(current_file_name) + skipcrud - 1;
I find it rather distracting to have 'skipcrud + current_file_name'
in some places and 'current_file_name + skipcrud' in others. Since
this occurs so often in this file, why not make it a macro:
#define CURRENT_FILE_NAME (skipcrud + current_file_name)
and use that instead???
BTW, here's a backtrace of when current_file_name gets clobbered by
extract_archive, as I noted in my previous posting. I haven't been
able to track down the error yet. Maybe this would help you...
(gdb) bt
#0 0x41a5b8 in read () at ../read.s:18
#1 0x4068e4 in fl_read () at buffer.c:893
#2 0x406e70 in flush_archive () at buffer.c:1051
#3 0x404f70 in findrec () at buffer.c:179
#4 0x404324 in extract_archive () at extract.c:377
#5 0x40a00c in read_and (do_something=0x403e3c <extract_archive>)
at list.c:141
#6 0x400320 in main (argc=3, argv=0x7fffbdd4) at tar.c:252
-----------------------------------------------------------------------------
Timothy Fossum -- UW-Parkside -- 900 Wood Road, Box 2000 -- Kenosha, WI 53141
Department of Computer Science and Engineering/fossum@cs.uwp.edu/414-595-2297
Technical Details
Message-ID:
<199210110422.AA09496@cs.uwp.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.uwp.edu!rootShow Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.uwp.edu!root From: root@cs.uwp.edu (System Account) Subject: tar-1.11 Message-ID: <199210110422.AA09496@cs.uwp.edu> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Sat, 10 Oct 1992 18:22:17 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 41