Fix badly computed output size in µBlock.base64.encode()

This bug could cause losing 1 to 3 bytes of information
dropped from various internal buffers at encoding time.

Possibly related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/cs1y26/
This commit is contained in:
Raymond Hill 2019-08-22 09:17:19 -04:00
parent 29745481e6
commit 708e5004e8
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -544,7 +544,7 @@
}
encode(arrbuf, arrlen) {
const inputLength = arrlen >>> 2;
const inputLength = (arrlen + 3) >>> 2;
const inbuf = new Uint32Array(arrbuf, 0, inputLength);
const outputLength = this.magic.length + 7 + inputLength * 7;
const outbuf = new Uint8Array(outputLength);