Subject: bin/27153: gzip doesn't continue past zero length data decompression
To: None <>
From: None <>
List: netbsd-bugs
Date: 10/05/2004 15:47:20
>Number:         27153
>Category:       bin
>Synopsis:       gzip doesn't continue past zero length data decompression
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 05 20:48:00 UTC 2004
>Originator:     Eric Haszlakiewicz
>Release:        NetBSD 2.0_BETA
System: NetBSD 2.0_BETA NetBSD 2.0_BETA (JODI) #5: Wed Jul 21 19:00:24 CDT 2004 i386
Architecture: i386
Machine: i386
	If a compressed data stream contains more than one "file" gzip will 
decompress each one in sequence.  This allows for an easy way to append
more data on to the end of a gzipped file but just appending the output
of an additional gzip command.
	This fails if one of those segments results in no data output.
The uncompression will just stop, with no indication that anything
is wrong.

	cat /dev/null | gzip -c > test.gz
	echo foo | gzip -c >> test.gz
	gzip -c -d test.gz

	Notice that there is no ouput.
	I'm not sure what, but it something different needs to happen with
the "if (wr == 0)" check around line 856 of gzip.c (rev 1.67).