Skip to content

Commit bfbd7f6

Browse files
committed
Fix parsing of invalid regex-like domain in static extended filters
Related issue: uBlockOrigin/uBlock-issues#4113
1 parent 96b477e commit bfbd7f6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/js/static-filtering-parser.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,11 @@ export class AstFilterParser {
22072207
if ( c0 === 0x2F /* / */ ) {
22082208
this.domainRegexValueParser.nextArg(this.raw, beg+1);
22092209
end = this.domainRegexValueParser.separatorEnd;
2210-
isRegex = true;
2210+
if ( end <= parentEnd ) {
2211+
isRegex = true;
2212+
} else {
2213+
end = -1;
2214+
}
22112215
} else if ( c0 === 0x5B /* [ */ && this.startsWith('[$domain=/', beg) ) {
22122216
end = this.indexOf('/]', beg + 10, parentEnd);
22132217
if ( end !== -1 ) { end += 2; }

0 commit comments

Comments
 (0)