1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-24 11:22:44 +01:00

code review: fix handling of too long needles

This commit is contained in:
Raymond Hill 2018-11-19 14:04:26 -05:00
parent 13f2b6b86f
commit 2a91a685ce
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -88,7 +88,7 @@ const hnTrieManager = {
if ( needle !== this.needle ) {
const buf = this.trie;
let i = needle.length;
if ( i > 255 ) { i = 255; }
if ( i > 254 ) { i = 254; }
buf[255] = i;
while ( i-- ) {
buf[i] = needle.charCodeAt(i);