From 8f630ba374669d8916a1addee2975625a17b0070 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Wed, 8 Jun 2022 18:36:51 +0300 Subject: [PATCH] Fix bug that accepted invalid zlib header when windowBits is zero. https://github.com/madler/zlib/commit/6cef1de7403b553ce8f7e790e38531da6529f34f --- lib/zlib/inflate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zlib/inflate.js b/lib/zlib/inflate.js index 8d27936..b30262e 100644 --- a/lib/zlib/inflate.js +++ b/lib/zlib/inflate.js @@ -469,7 +469,7 @@ const inflate = (strm, flush) => { if (state.wbits === 0) { state.wbits = len; } - else if (len > state.wbits) { + if (len > 15 || len > state.wbits) { strm.msg = 'invalid window size'; state.mode = BAD; break;