From 708e5004e8aabbdcf7c09e23cc5f84818e2893fb Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 22 Aug 2019 09:17:19 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20badly=20computed=20output=20size=20in=20?= =?UTF-8?q?=C2=B5Block.base64.encode()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/ --- src/js/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/utils.js b/src/js/utils.js index 728b3ee74..ee04159d7 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -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);