mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-18 17:02:27 +02:00
Fix testing a 8-bit integer instead of a 32-bit integer in PSL library
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2002 The code was testing only the LSB of a 32-bit integer to detect whether the current rule was a wildcard (`*`), while it had to compare against the whole 32-bit integer. The breakage occurred when the LSB of an offset to the character buffer happened to match the ASCII code of `*` (42, 0x2A). (An offset is used when a label is longer than 4 characters)
This commit is contained in:
parent
03b5ad1df2
commit
38855b1ff6
@ -403,7 +403,7 @@ const getPublicSuffixPosJS = function() {
|
|||||||
}
|
}
|
||||||
// 2. If no rules match, the prevailing rule is "*".
|
// 2. If no rules match, the prevailing rule is "*".
|
||||||
if ( iFound === 0 ) {
|
if ( iFound === 0 ) {
|
||||||
if ( buf8[iCandidates + 1 << 2] !== 0x2A /* '*' */ ) { break; }
|
if ( buf8[iCandidates + 1] !== 0x2A /* '*' */ ) { break; }
|
||||||
buf8[SUFFIX_NOT_FOUND_SLOT] = 1;
|
buf8[SUFFIX_NOT_FOUND_SLOT] = 1;
|
||||||
iFound = iCandidates;
|
iFound = iCandidates;
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
@ -255,7 +255,7 @@
|
|||||||
i32.eqz
|
i32.eqz
|
||||||
if
|
if
|
||||||
get_local $iCandidates
|
get_local $iCandidates
|
||||||
i32.load8_u offset=4
|
i32.load offset=4
|
||||||
i32.const 0x2A
|
i32.const 0x2A
|
||||||
i32.ne
|
i32.ne
|
||||||
br_if $labelLookupDone
|
br_if $labelLookupDone
|
||||||
|
Loading…
Reference in New Issue
Block a user