Subject: bin/27153: gzip doesn't continue past zero length data decompression
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <erh@nimenees.com>
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
>Closed-Date:
>Last-Modified:
>Originator:     Eric Haszlakiewicz
>Release:        NetBSD 2.0_BETA
>Organization:
	
>Environment:
System: NetBSD jodi.nimenees.com 2.0_BETA NetBSD 2.0_BETA (JODI) #5: Wed Jul 21 19:00:24 CDT 2004 erh@poe.swapsimple.com:/home/erh/netbsd/build/obj/home/erh/netbsd/src/sys/arch/i386/compile/JODI i386
Architecture: i386
Machine: i386
>Description:
	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.

>How-To-Repeat:
	cat /dev/null | gzip -c > test.gz
	echo foo | gzip -c >> test.gz
	gzip -c -d test.gz

	Notice that there is no ouput.
>Fix:
	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).

>Release-Note:
>Audit-Trail:
>Unformatted: