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

Fuzzed regex causes assertion-failure #250

Closed
lukaslueg opened this issue Jun 16, 2016 · 1 comment
Closed

Fuzzed regex causes assertion-failure #250

lukaslueg opened this issue Jun 16, 2016 · 1 comment
Labels

Comments

@lukaslueg
Copy link
Contributor

lukaslueg commented Jun 16, 2016

AFL found this regex which causes an assertion failure !ranges.is_empty() in regex-0.1.71/src/compile.rs:421 while Regex::new() using rustc-1.11.0-dev 2016-06-13. In release-mode it causes an index 18446744073709551615 out of range for slice of length 0.

/=(?-u:\?(?:\[\[:\[\[[^|\]]*(?:\|(?-u:\?[\[[]*(?:\|(?:[^|\]]*))2:[^|\]]*))25[σף]]*(?:\|(?:[^|\]]*)0?:[^|\]]*))25[0])�+

Beware the special characters. In Base64 it's Lz0oPy11Olw/KD86XFtcWzpcW1xbW158XF1dKig/Olx8KD8tdTpcP1tcW1tdKig/Olx8KD86W158
XF1dKikpMjpbXnxcXV0qKSkyNVvPg9ejXV0qKD86XHwoPzpbXnxcXV0qKTA/OltefFxdXSopKTI1
WzBdKX8r

@BurntSushi BurntSushi added the bug label Jun 16, 2016
@BurntSushi
Copy link
Member

Nice. This is a bug because Unicode literals should be disallowed in character classes when Unicode mode is disabled, but they weren't. A smaller reproducible example is (?-u)[☃].

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

No branches or pull requests

2 participants