From 5dcb622fc11587e894addfe3dd305ab2f17223dd Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 20 Dec 2006 23:30:17 +0000 Subject: [PATCH] * inflate.c (huft_build): Fix regression that caused gzip to refuse to uncompress null input (all zero length codes). Problem reported by Yiorgos Adamopoulos. This regression was caused by the security patch installed 2006-11-20, which in turn came from Debian, which in turn apparently came from Thomas Biege of SuSe. --- ChangeLog | 8 ++++++++ inflate.c | 13 ++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd6e350..9649dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-12-20 Paul Eggert + + * inflate.c (huft_build): Fix regression that caused gzip to + refuse to uncompress null input (all zero length codes). Problem + reported by Yiorgos Adamopoulos. This regression was caused by + the security patch installed 2006-11-20, which in turn came from + Debian, which in turn apparently came from Thomas Biege of SuSe. + 2006-12-15 Paul Eggert * NEWS, configure.ac (AC_INIT): diff --git a/inflate.c b/inflate.c index e5aa0d8..efca2bf 100644 --- a/inflate.c +++ b/inflate.c @@ -335,9 +335,16 @@ int *m; /* maximum lookup bits, returns actual */ } while (--i); if (c[0] == n) /* null input--all zero length codes */ { - *t = (struct huft *)NULL; - *m = 0; - return 2; + q = (struct huft *) malloc (2 * sizeof *q); + if (!q) + return 3; + hufts += 2; + q[0].v.t = (struct huft *) NULL; + q[1].e = 99; /* invalid code marker */ + q[1].b = 1; + *t = q + 1; + *m = 1; + return 0; } -- 2.30.2