[BusyBox] bug#1265: marked as done (gunzip hangs on some truncated/corrupted .gz files)

BusyBox.net bug Tracking System owner at busybox.net
Mon Sep 16 01:46:37 UTC 2002


Your message dated Mon, 16 Sep 2002 01:26:26 -0600
with message-id <20020916072625.GA22261 at codepoet.org>
and subject line [BusyBox] bug#1265: patch which fixes the gunzip hang problem
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Erik Andersen
(administrator, BusyBox.net bugs database)

--------------------------------------
Received: (at submit) by bugs.busybox.net; 15 Aug 2002 17:17:41 +0000
>From matthias at corelatus.com  Thu Aug 15 11:17:41 2002
Received: by winder.codepoet.org (Postfix, from userid 104)
	id 84E1115799F; Thu, 15 Aug 2002 11:17:40 -0600 (MDT)
Received: from maild.telia.com (maild.telia.com [194.22.190.101])
	by winder.codepoet.org (Postfix) with ESMTP id 6EF6715787E
	for <submit at bugs.busybox.net>; Thu, 15 Aug 2002 11:17:34 -0600 (MDT)
Received: from d1o883.telia.com (d1o883.telia.com [213.66.144.241])
	by maild.telia.com (8.12.5/8.12.5) with ESMTP id g7FHHUpi027957
	for <submit at bugs.busybox.net>; Thu, 15 Aug 2002 19:17:30 +0200 (CEST)
X-Original-Recipient: <submit at bugs.busybox.net>
Received: from antilipe.corelatus.se (h244n2fls31o883.telia.com [217.208.60.244])
	by d1o883.telia.com (8.10.2/8.10.1) with ESMTP id g7FHHU614313
	for <submit at bugs.busybox.net>; Thu, 15 Aug 2002 19:17:30 +0200 (CEST)
Received: from matthias by antilipe.corelatus.se with local (Exim 3.35 #1 (Debian))
	id 17fOFl-0000dT-00
	for <submit at bugs.busybox.net>; Thu, 15 Aug 2002 19:17:45 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <15707.57912.946638.938279 at antilipe.corelatus.se>
Date: Thu, 15 Aug 2002 19:17:44 +0200
From: Matthias Lang <matthias at corelatus.se>
To: submit at bugs.busybox.net
Subject: gunzip hangs on some truncated/corrupted .gz files
X-Mailer: VM 7.03 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
Reply-To: matthias at corelatus.com
Sender: Matthias <matthias at corelatus.com>
X-Spam-Status: No, hits=0.0 required=5.0
	tests=none
	version=2.31
X-Spam-Level: 


Package: busybox
Version: 0.60.3
Severity: normal

The busybox gunzip code hangs on several different types of files,
including truncated .gz files and files which aren't real .gz
files. Example:

   >hexdump contrived.gz
   000000 1f 8b 08 08 00 00 00 00 00 00 63

   >gunzip -c contrived.gz                       (real gunzip 1.3.2)
   gunzip: contrived.gz: unexpected end of file

   >busybox-0.60.3/busybox gunzip -c contrived.gz 
   (hangs forever)

This is caused by busybox gunzip ignoring EOF in several places, for
instance in unzip.c:

      if ((flags & orig_name) != 0) {
              while (fgetc(in_file) != 0);    /* null */
      }

I haven't written a patch---I'm not sure that the hanging behaviour is
a conscious design tradeoff.

Matt

---
http://www.corelatus.com
---------------------------------------
Received: (at 1265-done) by bugs.busybox.net; 16 Sep 2002 07:26:28 +0000
>From andersen at codepoet.org  Mon Sep 16 01:26:28 2002
Received: by winder.codepoet.org (Postfix, from userid 1000)
	id 1AA35157997; Mon, 16 Sep 2002 01:26:26 -0600 (MDT)
Date: Mon, 16 Sep 2002 01:26:26 -0600
From: Erik Andersen <andersen at codepoet.org>
To: matthias at corelatus.com, 1265-done at bugs.busybox.net
Subject: Re: [BusyBox] bug#1265: patch which fixes the gunzip hang problem
Message-ID: <20020916072625.GA22261 at codepoet.org>
Reply-To: andersen at codepoet.org
References: <15708.46934.237395.210576 at antilipe.corelatus.se>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <15708.46934.237395.210576 at antilipe.corelatus.se>
User-Agent: Mutt/1.3.28i
X-Operating-System: Linux 2.4.18-rmk7, Rebel-NetWinder(Intel StrongARM 110 rev 3), 185.95 BogoMips
X-No-Junk-Mail: I do not want to get *any* junk mail.

On Fri Aug 16, 2002 at 10:27:02AM +0200, Matthias Lang wrote:
> I modified unzip.c to check the return value of fgetc() in all cases
> except those where it was obvious that an ignored EOF couldn't result
> in a hang. The patch doesn't seem to make things larger or slower:

Patch looks good.  Applied, thanks!

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/



More information about the busybox mailing list