From d53e75c30915f9a38af58aa8410fff0c1f748216 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Wed, 8 Jun 2022 19:53:51 +0300 Subject: [PATCH] Reject a window size of 256 bytes if not using the zlib wrapper. https://github.com/madler/zlib/commit/049578f0a1849f502834167e233f4c1d52ddcbcc --- lib/zlib/deflate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zlib/deflate.js b/lib/zlib/deflate.js index 0f9bbad..856be4f 100644 --- a/lib/zlib/deflate.js +++ b/lib/zlib/deflate.js @@ -1329,7 +1329,7 @@ const deflateInit2 = (strm, level, method, windowBits, memLevel, strategy) => { if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { + strategy < 0 || strategy > Z_FIXED || (windowBits === 8 && wrap !== 1)) { return err(strm, Z_STREAM_ERROR); }