X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=inflate.c;h=9f3a6616e18e1ca70eaa0c1b88bde43a0209211c;hb=refs%2Ftags%2Fupstream%2F1.3.12;hp=88119056b22f15338c9ea5f32631f910953bfdd4;hpb=0d5a754ba8f2cc33e98d48d559f0ad6cd18a43a3;p=debian%2Fgzip diff --git a/inflate.c b/inflate.c index 8811905..9f3a661 100644 --- a/inflate.c +++ b/inflate.c @@ -116,7 +116,7 @@ */ #ifdef RCSID -static char rcsid[] = "$Id: inflate.c,v 1.5 2006/11/27 00:51:37 eggert Exp $"; +static char rcsid[] = "$Id: inflate.c,v 1.6 2006/12/20 23:30:17 eggert Exp $"; #endif #include @@ -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; }