1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-04 10:09:38 +02:00

Fix edge case involving filter with a single wildcard

This fix the case of the following filter:

    trk*.vidible.tv

Not matching:

    https://trk.vidible.tv/trk/.vidible.tv

The wildcard is supposed to match any number of
characters, including zero characters. The issue
is that the code was not matching zero characters.

This is due to an incorrect comparison in
BidiTrieContainer.indexOf(), causing the code to
bail out before testing for the zero character
condition.
This commit is contained in:
Raymond Hill 2020-06-27 07:58:46 -04:00
parent ca0c48717b
commit a08cdd721a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
3 changed files with 3 additions and 3 deletions

View File

@ -658,7 +658,7 @@ const roundToPageSize = v => (v + PAGE_SIZE-1) & ~(PAGE_SIZE-1);
i += 1;
}
haystackLeft += 1;
if ( haystackLeft === haystackEnd ) { break; }
if ( haystackLeft > haystackEnd ) { break; }
}
return -1;
}

Binary file not shown.

View File

@ -606,9 +606,9 @@
i32.const 1
i32.add
tee_local $haystackLeft
;; if ( haystackLeft === haystackEnd ) { break; }
;; if ( haystackLeft > haystackEnd ) { break; }
get_local $haystackEnd
i32.eq
i32.gt_u
br_if $fail
br $mainLoop
;; }