attachment padding not enforced to be 0x00 (#1640)

pull/1642/head
Audric Ackermann 5 years ago committed by GitHub
parent 78778718b7
commit 57192699fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -65,13 +65,7 @@ export function getUnpaddedAttachment(
if (data.byteLength <= unpaddedExpectedSize) {
return null;
}
const dataUint = new Uint8Array(data);
for (let i = unpaddedExpectedSize; i < data.byteLength; i++) {
if (dataUint[i] !== PADDING_BYTE) {
return null;
}
}
// we know consider that anything coming after the expected size is padding, no matter what there is there
return data.slice(0, unpaddedExpectedSize);
}

Loading…
Cancel
Save