We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What steps will reproduce the bug? I executed fuzz testing with bat public APIs and found crash case.
bat
let fuzz_arg1 = "18446744073709551615:+1"; LineRange::from(fuzz_arg1);
What happens?
Thread '<unnamed>' panicked at 'attempt to add with overflow', /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/arith.rs:109
The overflow occurs with this statement :
bat/src/line_range.rs
Line 56 in 5a240f3
What did you expect to happen instead? Need assertion to prevent arith overflow, or need to explicitly mention panic condition.
The text was updated successfully, but these errors were encountered:
Maybe saturating_add(new_range.lower, more_lines) can be done here to avoid panicking.
saturating_add(new_range.lower, more_lines)
Sorry, something went wrong.
Looks nice, better than assert!.
assert!
LineRange::parse_range
lib/functions/general/bat-cat.sh
Successfully merging a pull request may close this issue.
What steps will reproduce the bug?
I executed fuzz testing with
bat
public APIs and found crash case.What happens?
The overflow occurs with this statement :
bat/src/line_range.rs
Line 56 in 5a240f3
What did you expect to happen instead?
Need assertion to prevent arith overflow, or need to explicitly mention panic condition.
The text was updated successfully, but these errors were encountered: