summaryrefslogtreecommitdiff
path: root/lib/inflate.c
diff options
context:
space:
mode:
authorTim Yamin <plasmaroo@gentoo.org>2005-07-25 23:16:13 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-05 16:23:21 -0700
commit4aad724d3e52238e1ce005f166fbba5b4072a7f6 (patch)
treec313006c1e59a41914a96c0c0b5b2b557736a0a9 /lib/inflate.c
parent00a5dfdb93f74e4d95fb0d83c890728e331f8810 (diff)
downloadlwn-4aad724d3e52238e1ce005f166fbba5b4072a7f6.tar.gz
lwn-4aad724d3e52238e1ce005f166fbba5b4072a7f6.zip
[PATCH] Update in-kernel zlib routines
These bugs have been fixed in the standard zlib for a while. See for example 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: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib/inflate.c')
-rw-r--r--lib/inflate.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/inflate.c b/lib/inflate.c
index 75e7d303c72e..6db6e98d1637 100644
--- a/lib/inflate.c
+++ b/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 */