| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 29666
Use Instant::checked_add() to prevent panic on overflow.
Line 122 uses unchecked Instant::now() + dur, which will panic if the duration is large enough to overflow the Instant. The Duration conversion at line 101 does not validate that the resulting value is within Instant's safe range. Replace with checked_add() and raise OverflowError.
Proposed fixVerify each finding against the current code and only fix it if needed. In `@crates/vm/src/stdlib/time.rs` around lines 122 - 123, Replace the unchecked addition Instant::now() + dur when computing deadline with Instant::now().checked_add(dur) and handle the None case by returning/raising an OverflowError; specifically, change the code that assigns deadline (the Instant::now() + dur expression) to use Instant::now().checked_add(dur).ok_or_else(|| OverflowError::new("timeout overflow")) (or the crate's equivalent VM error constructor) before entering the loop so that overflow is detected and an OverflowError is returned instead of panicking.Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.