diff --git a/inflate.c b/inflate.c index 72e8438d7eb45e7037b86a65619d6f2dd8893af8..5a687a6973047a64885e2ac8b8de3a1a42b3942d 100644 --- a/inflate.c +++ b/inflate.c @@ -674,7 +674,7 @@ int flush; len = BITS(4) + 8; if (state->wbits == 0) state->wbits = len; - else if (len > state->wbits) { + if (len > 15 || len > state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break;