mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Alain Knaff <alain@knaff.lu>, Sam Ravnborg <sam@ravnborg.org>,
	x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Alain Knaff <alain@knaff.lu>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH] bzip2/lzma: fix decompress_inflate.c vs multi-block-with-embedded-filename
Date: Thu,  8 Jan 2009 15:28:59 -0800	[thread overview]
Message-ID: <1231457340-18045-3-git-send-email-hpa@zytor.com> (raw)
In-Reply-To: <1231457340-18045-2-git-send-email-hpa@zytor.com>

From: Alain Knaff <alain@knaff.lu>

Impact: Bug fix

Fix gunzip uncompression, so that it also works with files with
embedded filenames that are larger than one block.

Signed-off-by: Alain Knaff <alain@knaff.lu>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 lib/decompress_inflate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index d2e7c75..839a329 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -97,7 +97,7 @@ STATIC int INIT gunzip(unsigned char *buf, int len,
 			strm->next_in++;
 		strm->next_in++;
 	}
-	strm->avail_in = len - 10;
+	strm->avail_in = len - (strm->next_in - zbuf);
 
 	strm->next_out = out_buf;
 	strm->avail_out = out_len;
-- 
1.5.6.6


  reply	other threads:[~2009-01-08 23:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-08 23:28 Additional patches applied to tip:x86/setup-lzma H. Peter Anvin
2009-01-08 23:28 ` [PATCH] bzip2/lzma: fix constant in decompress_inflate H. Peter Anvin
2009-01-08 23:28   ` H. Peter Anvin [this message]
2009-01-08 23:29     ` [PATCH] bzip2/lzma: centralize format detection H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1231457340-18045-3-git-send-email-hpa@zytor.com \
    --to=hpa@zytor.com \
    --cc=alain@knaff.lu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®