Package: tar
Version: 1.16-2
Severity: normal

To reproduce the error do this:

1- echo "filename" > filelist
2- echo "" >>filelist
3- tar xvfz tarfile.tgz -T filelist

Note: its not necessary that "filename" exists.

When you use -T, the contents of the file is dumped into the argv
vector. Each line should contain a file name, optionally with its path.

You will have a segment violation because on line 421 of lib/getopt.c
you have:

if (d->optind != argc && !strcmp (argv[d->optind], "--"))

optind will point to the position in argv where the file name is stored,
in the case of the emppy line argv[d->optind] will point to an empty
string, so strcmp will SIGSEGV.

There are two possible options as I see it.

1- Changing that line to: 
if (d->optind != argc && argv[d->optind] && !strcmp (argv[d->optind], "--"))

2- Fix the parsing of -T so an empty line won't be included in the dump
to argv vector.

Both options could be included at once, since #1 will robust these
processing in case some other similar error happens, but just #2 will
also suffice.

I tried to report this upstream but bug reporting is limited to memebers
of the project.

Regads,HTH.

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (900, 'testing'), (100, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18p4s
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8)

Versions of packages tar depends on:
ii  libc6                       2.3.6.ds1-11 GNU C Library: Shared libraries

tar recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to