X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=inflate.c;h=bcafcf1a12368ce294aedd17eb30897561f023f6;hb=636f0d36c7b11671b8d36e80c41de03d729d92a9;hp=ff2be7e0fecd2dd0884b5fafd4839381e1ac0471;hpb=2e7e88b2efec90c4ad9dc7a24d533b36a6223be2;p=debian%2Fgzip diff --git a/inflate.c b/inflate.c index ff2be7e..bcafcf1 100644 --- a/inflate.c +++ b/inflate.c @@ -1,6 +1,6 @@ /* Inflate deflated data - Copyright (C) 1997-1999, 2002, 2006, 2009-2016 Free Software Foundation, + Copyright (C) 1997-1999, 2002, 2006, 2009-2018 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -799,6 +799,12 @@ inflate_dynamic(void) NEEDBITS((unsigned)bl) j = (td = tl + ((unsigned)b & m))->b; DUMPBITS(j) + if (td->e == 99) + { + /* Invalid code. */ + huft_free (tl); + return 2; + } j = td->v.n; if (j < 16) /* length of code in bits (0..15) */ ll[i++] = l = j; /* save last length in l */