🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #836

Problem with GNU tar 1.11

#836
From: Marc Unangst
Date: Sun, 13 Sep 1992 22:08
28 lines
1699 bytes
There seems to be a bug in GNU tar 1.11's "-v" option.  I am running
on an Intel SVR4 (Esix 4.0.3A) machine, compiling with gcc v2.1.
Aside from commenting out a few

extern char *valloc();

declarations (because they conflicted with the ones in <stdlib.h>), I
have not modified the source.

The problem is that tar prints out a blank line where the filename
should be when -v is given during archive creation (i.e., with the
-c flag).  Using multiple -v's, which should increase the debugging
level, results in a segmentation fault.

I have traced through the code, and it seems that the problem is that
the global current_file_name is not being set correctly when
print_header is called.  print_header attempts to get the current file
name from current_file_name, and so it prints out nothing.  tar
segvios when multiple -v's are given because at the higher debugging
levels, tar tries to do strlen(current_file_name), which results in
strlen being passed a null pointer.

Where and how should current_file_name be set?

-- 
Marc Unangst                | Real men don't use Windows.  Real men use X. 
mju@mudos.ann-arbor.mi.us   | Only a real man would use a GUI where the
                            | shift keys after "Alt" are "Super" and "Hyper."
Technical Details
Message-ID: <BuJEu5.4Bt@mudos.ann-arbor.mi.us>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mudos.ann-arbor.mi.US!mju

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mudos.ann-arbor.mi.US!mju
From: mju@mudos.ann-arbor.mi.US (Marc Unangst)
Subject: Problem with GNU tar 1.11
Message-ID: <BuJEu5.4Bt@mudos.ann-arbor.mi.us>
Sender: gnulists@ai.mit.edu
Organization: The Programmer's Pit Stop, Ann Arbor MI
Distribution: gnu
Date: Sun, 13 Sep 1992 22:08:28 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 29