Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfRangeException when parsing some rules #23

Open
Sergio0694 opened this issue Jun 7, 2019 · 1 comment
Open

IndexOutOfRangeException when parsing some rules #23

Sergio0694 opened this issue Jun 7, 2019 · 1 comment

Comments

@Sergio0694
Copy link

Sergio0694 commented Jun 7, 2019

Hi,
I've noticed that the AbpFormatRuleParser.ParseAbpFormattedRule API is throwing an IndexOutOfRangeException when parsing some rules.
In particular, I've noticed the crash when parsing this line from the EasyList Privacy ruleset (https://easylist.to/easylist/easyprivacy.txt):

@@||adobedtm.com^*/satelliteLib-$script,domain=|absa.co.za|argos.co.uk|collegeboard.org|crackle.com|crimewatchdaily.com|directline.com|fcbarcelona.com|jeep.com|laredoute.co.uk|laredoute.com|lenovo.com|lowes.com|mastercard.us|mathworks.com|monoprice.com|nbcnews.com|newyorker.com|oprah.com|pnc.com|realtor.com|redbull.tv|repco.co.nz|searspartsdirect.com|smooth.com.au|sonycrackle.com|stuff.co.nz|subaru.com|timewarnercable.com|trip-planner.australia.com|vanityfair.com|wired.com

I can work around it by using a try/catch block around all the calls to ParseAbpFormattedRule for now, although that's not ideal as it introduces some overhead.

Hope this helps, keep up the good work! 😊

EDIT: on second thought, I think I'll keep the try/catch block in place just to be extra sure, so that I won't get any crashes even if the ruleset changed in the future. Still though, it might be a good idea to have the lib properly handle at least this particular case, now that we've found it.

@TechnikEmpire
Copy link
Owner

Thanks for reporting. I'll get to this next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants