public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	"Randy.Dunlap" <rdunlap@xenotime.net>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	Tim Yamin <plasmaroo@gentoo.org>,
	Tavis Ormandy <taviso@gentoo.org>, Chris Wright <chrisw@osdl.org>
Subject: [patch 4/8] [PATCH] Update in-kernel zlib routines
Date: Thu, 11 Aug 2005 15:54:49 -0700	[thread overview]
Message-ID: <20050811225626.233013000@localhost.localdomain> (raw)
In-Reply-To: 20050811225445.404816000@localhost.localdomain

[-- Attachment #1: linux-zlib-fixes.patch --]
[-- Type: text/plain, Size: 2793 bytes --]

-stable review patch.  If anyone has any  objections, please let us know.
------------------


a) http://sources.redhat.com/ml/bug-gnu-utils/1999-06/msg00183.html
b) http://bugs.gentoo.org/show_bug.cgi?id=94584

Signed-off-by: Tim Yamin <plasmaroo@gentoo.org>
Signed-off-by: Tavis Ormandy <taviso@gentoo.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
---
 arch/ppc64/boot/zlib.c      |    3 ++-
 lib/inflate.c               |   16 +++++++++-------
 lib/zlib_inflate/inftrees.c |    2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)

Index: linux-2.6.12.y/lib/inflate.c
===================================================================
--- linux-2.6.12.y.orig/lib/inflate.c
+++ linux-2.6.12.y/lib/inflate.c
@@ -326,7 +326,7 @@ DEBG("huft1 ");
   {
     *t = (struct huft *)NULL;
     *m = 0;
-    return 0;
+    return 2;
   }
 
 DEBG("huft2 ");
@@ -374,6 +374,7 @@ DEBG("huft5 ");
     if ((j = *p++) != 0)
       v[x[j]++] = i;
   } while (++i < n);
+  n = x[g];                   /* set n to length of v */
 
 DEBG("h6 ");
 
@@ -410,12 +411,13 @@ DEBG1("1 ");
 DEBG1("2 ");
           f -= a + 1;           /* deduct codes from patterns left */
           xp = c + k;
-          while (++j < z)       /* try smaller tables up to z bits */
-          {
-            if ((f <<= 1) <= *++xp)
-              break;            /* enough codes to use up j bits */
-            f -= *xp;           /* else deduct codes from patterns */
-          }
+          if (j < z)
+            while (++j < z)       /* try smaller tables up to z bits */
+            {
+              if ((f <<= 1) <= *++xp)
+                break;            /* enough codes to use up j bits */
+              f -= *xp;           /* else deduct codes from patterns */
+            }
         }
 DEBG1("3 ");
         z = 1 << j;             /* table entries for j-bit table */
Index: linux-2.6.12.y/lib/zlib_inflate/inftrees.c
===================================================================
--- linux-2.6.12.y.orig/lib/zlib_inflate/inftrees.c
+++ linux-2.6.12.y/lib/zlib_inflate/inftrees.c
@@ -141,7 +141,7 @@ static int huft_build(
   {
     *t = NULL;
     *m = 0;
-    return Z_OK;
+    return Z_DATA_ERROR;
   }
 
 
Index: linux-2.6.12.y/arch/ppc64/boot/zlib.c
===================================================================
--- linux-2.6.12.y.orig/arch/ppc64/boot/zlib.c
+++ linux-2.6.12.y/arch/ppc64/boot/zlib.c
@@ -1307,7 +1307,7 @@ local int huft_build(
   {
     *t = (inflate_huft *)Z_NULL;
     *m = 0;
-    return Z_OK;
+    return Z_DATA_ERROR;
   }
 
 
@@ -1351,6 +1351,7 @@ local int huft_build(
     if ((j = *p++) != 0)
       v[x[j]++] = i;
   } while (++i < n);
+  n = x[g];			/* set n to length of v */
 
 
   /* Generate the Huffman codes and for each, make the table entries */

--

  parent reply	other threads:[~2005-08-11 22:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-11 22:54 [patch 0/8] -stable review Chris Wright
2005-08-11 22:54 ` [patch 1/8] [PATCH] sys_set_mempolicy() doesnt check if mode < 0 Chris Wright
2005-08-11 22:54 ` [patch 2/8] [PATCH] Fix SRAT for non dual core AMD systems Chris Wright
2005-08-11 22:54 ` [patch 3/8] [PATCH] x86_64: Fixing smpboot timing problem Chris Wright
2005-08-11 23:33   ` Andi Kleen
2005-08-11 23:43     ` Chris Wright
2005-08-12  2:32       ` Eric W. Biederman
2005-08-12  4:26     ` [PATCH] x86_64: Fix apicid versus cpu# confusion Eric W. Biederman
2005-08-12  5:51       ` yhlu
2005-08-11 22:54 ` Chris Wright [this message]
2005-08-12  0:01   ` [patch 4/8] [PATCH] Update in-kernel zlib routines Peter Osterlund
2005-08-12  0:11     ` Chris Wright
2005-08-11 22:54 ` [patch 5/8] Check input buffer size in zisofs Chris Wright
2005-08-12  1:12   ` H. Peter Anvin
2005-08-12  1:16     ` Chris Wright
2005-08-11 22:54 ` [patch 6/8] CAN-2005-2098 Error during attempt to join key management session can leave semaphore pinned Chris Wright
2005-08-11 22:54 ` [patch 7/8] CAN-2005-2099 Destruction of failed keyring oopses Chris Wright
2005-08-11 22:54 ` [patch 8/8] [PATCH] Module per-cpu alignment cannot always be met Chris Wright
2005-08-22  6:58   ` Denis Vlasenko

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=20050811225626.233013000@localhost.localdomain \
    --to=chrisw@osdl.org \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chuckw@quantumlinux.com \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plasmaroo@gentoo.org \
    --cc=rdunlap@xenotime.net \
    --cc=stable@kernel.org \
    --cc=taviso@gentoo.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /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