🐛 Fix reading extra field from solidpkg

This commit is contained in:
C-3PO 2018-06-21 23:08:17 +02:00
parent 561b285f2f
commit 400be4f296
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -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) {