-
Notifications
You must be signed in to change notification settings - Fork 444
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
Program unexpected panic when slice start index used #948
Comments
I added these debug statements to the body of your std::dbg!(_param0);
std::dbg!(_param1);
std::dbg!(_param2); And then ran your program and got:
Thus, while the panic is originating inside the regex library, the panic comes from providing an invalid offset in the first place. This isn't an issue with the regex library. |
In the future, when reporting a bug, please provide a program that looks more like this: fn main() {
let pattern = "\0 \0\0\0\u{14};:;;\u{1}\u{1b}:D;J[;;;--]";
let haystack = "/;*\u{1f}]/\u{1b}:;---\u{1b}:;;;;<;;;:\0";
let at = 16607023625928704;
let re = regex::Regex::new(pattern).unwrap();
let result = re.shortest_match_at(haystack, at);
dbg!(result);
} This makes it much clearer what's going on and that the fault lies with the input. Your submission instead contains what looks like auto-generated code and the actual relevant input parameters are not clear. |
Thank you very much for your timely reply. I have understood the reason, and I will make improvements to your suggestions. |
What version of regex are you using?
1.7.1
Describe the bug at a high level.
Program range start index out of range for slice, which causing a panic.
What are the steps to reproduce the behavior?
Using auto-generated fuzz target can reproduce the behavior. it was uploaded to the issue platform.
start_index_out_of_range.zip
Similar problems were found in the fuzzy test:
What is the actual behavior?
Panic happens, the program crashes.
What is the expected behavior?
Handle start index out of range without causing a panic
The text was updated successfully, but these errors were encountered: