From d66cd1116c0e47dc6ba8216eac936c04ce7d234f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sat, 25 Dec 2021 07:51:12 -0500 Subject: [PATCH] Fix not properly resetting needle buffer in createTrieFromStoredDomainOpt() Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1902 The cached needle didn't match the one stored in the needle buffer when resetting the cached needle without resetting the needle buffer. --- src/js/hntrie.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/hntrie.js b/src/js/hntrie.js index d4953310c..f125b2e6a 100644 --- a/src/js/hntrie.js +++ b/src/js/hntrie.js @@ -266,7 +266,8 @@ class HNTrieContainer { this.add(itrie); } } - this.needle = ''; // Important + this.needle = ''; // Important + this.buf[255] = 0; // Important return itrie; }