Skip to content

IndexOutOfRangeException when parsing some rulesΒ #23

@Sergio0694

Description

@Sergio0694

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions