diff options
author | Tim Yamin <plasmaroo@gentoo.org> | 2005-07-25 18:16:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-05 19:23:21 -0400 |
commit | 4aad724d3e52238e1ce005f166fbba5b4072a7f6 (patch) | |
tree | c313006c1e59a41914a96c0c0b5b2b557736a0a9 /lib/inflate.c | |
parent | 00a5dfdb93f74e4d95fb0d83c890728e331f8810 (diff) |
[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.c | 16 |
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 "); | |||
326 | { | 326 | { |
327 | *t = (struct huft *)NULL; | 327 | *t = (struct huft *)NULL; |
328 | *m = 0; | 328 | *m = 0; |
329 | return 0; | 329 | return 2; |
330 | } | 330 | } |
331 | 331 | ||
332 | DEBG("huft2 "); | 332 | DEBG("huft2 "); |
@@ -374,6 +374,7 @@ DEBG("huft5 "); | |||
374 | if ((j = *p++) != 0) | 374 | if ((j = *p++) != 0) |
375 | v[x[j]++] = i; | 375 | v[x[j]++] = i; |
376 | } while (++i < n); | 376 | } while (++i < n); |
377 | n = x[g]; /* set n to length of v */ | ||
377 | 378 | ||
378 | DEBG("h6 "); | 379 | DEBG("h6 "); |
379 | 380 | ||
@@ -410,12 +411,13 @@ DEBG1("1 "); | |||
410 | DEBG1("2 "); | 411 | DEBG1("2 "); |
411 | f -= a + 1; /* deduct codes from patterns left */ | 412 | f -= a + 1; /* deduct codes from patterns left */ |
412 | xp = c + k; | 413 | xp = c + k; |
413 | while (++j < z) /* try smaller tables up to z bits */ | 414 | if (j < z) |
414 | { | 415 | while (++j < z) /* try smaller tables up to z bits */ |
415 | if ((f <<= 1) <= *++xp) | 416 | { |
416 | break; /* enough codes to use up j bits */ | 417 | if ((f <<= 1) <= *++xp) |
417 | f -= *xp; /* else deduct codes from patterns */ | 418 | break; /* enough codes to use up j bits */ |
418 | } | 419 | f -= *xp; /* else deduct codes from patterns */ |
420 | } | ||
419 | } | 421 | } |
420 | DEBG1("3 "); | 422 | DEBG1("3 "); |
421 | z = 1 << j; /* table entries for j-bit table */ | 423 | z = 1 << j; /* table entries for j-bit table */ |