brave-experiments / ad-block

Ad block engine used in the Brave browser for ABP filter syntax based lists like EasyList.
https://www.brave.com
Mozilla Public License 2.0
239 stars 95 forks source link

Fix bug in regex parsing #174

Closed bbondy closed 5 years ago

bbondy commented 5 years ago

We were wrongly checking end of the input buffer to see if a filter was a regex, instead of the end of the filter. So if the file ended in a slash then we would store a big regex of the length from the start of the regex to the end of the file as the regex itself, then continue parsing as usual from the next filter correctly.

If the last line ended with a newline it would always detect things to not be regexs.

This has no effect on clients since they don't parse things, they just use already created DAT files.

Fix https://github.com/brave/ad-block/issues/173

pes10k commented 5 years ago

lgtm 👍