-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automata: fix unintended panic in max_haystack_len
This fixes a bug where the bounded backtracker's `max_haystack_len` could panic if its bitset capacity ended up being smaller than the total number of NFA states. Under a default configuration this seems unlikely to happen due to the default limits on the size of a compiled regex. But if the compiled regex size limit is increased to a large number, then the likelihood of this panicking increases. Of course, one can provoke this even easier by just setting the visited capacity to a small number. Indeed, this is how we provoke it in a regression test.
- Loading branch information
1 parent
27a2538
commit aa4e4c7
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters