From f2830d0ca00248e549f1cdbedd48bb9d5486968b Mon Sep 17 00:00:00 2001 From: code-sunbo Date: Thu, 11 Jul 2024 16:01:37 +0800 Subject: [PATCH] Add a length check when extra field parsed Signed-off-by: code-sunbo --- zipEntry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zipEntry.js b/zipEntry.js index 39aed71..e7804b6 100644 --- a/zipEntry.js +++ b/zipEntry.js @@ -193,7 +193,7 @@ module.exports = function (/** object */ options, /*Buffer*/ input) { try { var offset = 0; var signature, size, part; - while (offset < data.length) { + while (offset + 4 < data.length) { signature = data.readUInt16LE(offset); offset += 2; size = data.readUInt16LE(offset);