From 400be4f296689fe4a691213407017ecb8608d70f Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 21 Jun 2018 23:08:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20reading=20extra=20field=20?= =?UTF-8?q?from=20solidpkg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/readSolidpkg.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ssn/readSolidpkg.ts b/src/ssn/readSolidpkg.ts index 717ef91..f475008 100644 --- a/src/ssn/readSolidpkg.ts +++ b/src/ssn/readSolidpkg.ts @@ -85,7 +85,8 @@ export default function readSolidpkg(buffer: Buffer) { //read password from extra field let encodedPassword: Uint8Array | undefined; - while (pos + 4 <= extraFieldLength) { + const extraFieldEnd = pos + extraFieldLength; + while (pos + 4 <= extraFieldEnd) { const fieldId = dv.getUint16(pos, true); pos += 2; const fieldLength = dv.getUint16(pos, true); pos += 2; switch (fieldId) {