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

Endless loop in Regex::captures_iter() #255

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

Endless loop in Regex::captures_iter() #255

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

Comments

@lukaslueg
Copy link
Contributor

AFL found this simple regex that causes Regex::captures_iter() in regex-0.1.71 to enter into an endless loop.

regex::Regex::new("a$").unwrap().captures_iter("a").last()
@BurntSushi BurntSushi added the bug label Jul 9, 2016
@BurntSushi
Copy link
Member

This appears to be an invalid match bug. Namely, this assert fails:

assert!(Regex::new("a$").unwrap().find_at("a", 1).is_none());

BurntSushi added a commit that referenced this issue Jul 10, 2016
If we ignore the start offset, then we may report a match where none
exists. This can in particular lead to a match loop that never terminates.

Fixes #255.
BurntSushi added a commit that referenced this issue Jul 10, 2016
The bug shown in #251 has the same underlying cause as the bug in
#255, which has been fixed in a previous commit. This commit just adds
a more specific regression test for #251.

Fixes #251.
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