mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 01:27:12 +02:00
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:
parent
29745481e6
commit
708e5004e8
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user