mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00: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
1 changed files with 1 additions and 1 deletions
|
|
@ -544,7 +544,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
encode(arrbuf, arrlen) {
|
encode(arrbuf, arrlen) {
|
||||||
const inputLength = arrlen >>> 2;
|
const inputLength = (arrlen + 3) >>> 2;
|
||||||
const inbuf = new Uint32Array(arrbuf, 0, inputLength);
|
const inbuf = new Uint32Array(arrbuf, 0, inputLength);
|
||||||
const outputLength = this.magic.length + 7 + inputLength * 7;
|
const outputLength = this.magic.length + 7 + inputLength * 7;
|
||||||
const outbuf = new Uint8Array(outputLength);
|
const outbuf = new Uint8Array(outputLength);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue