From 1b068c15fb806194f466ee5e2b690f42d4f157bb Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 22 Nov 2019 18:22:21 -0500 Subject: [PATCH] Fix token array being too small for very long URL Related feedback: - https://www.reddit.com/r/uBlockOrigin/comments/dzw57l/ Each token requires two slots in the token indices array. This commit fixes uBO breaking when dealing with very long URLs with lot of distinct tokens in them. --- src/js/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/utils.js b/src/js/utils.js index b07af4bc2..e97963bad 100644 --- a/src/js/utils.js +++ b/src/js/utils.js @@ -61,7 +61,9 @@ this._urlIn = ''; this._urlOut = ''; this._tokenized = false; - this._tokens = new Uint32Array(1024); + // https://www.reddit.com/r/uBlockOrigin/comments/dzw57l/ + // Remember: 1 token needs two slots + this._tokens = new Uint32Array(2064); this.knownTokens = new Uint8Array(65536); this.resetKnownTokens();