-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add an overflow check in truncate implementation for Unix. #63332
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @kennytm (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors: r+ Thanks! |
📌 Commit 3cd9f3f has been approved by |
Add an overflow check in truncate implementation for Unix. Closes rust-lang#63326. cc @alexcrichton
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.
Failed in #63354 (comment)
return cvt_r(|| unsafe { | ||
ftruncate64(self.0.raw(), size as off64_t) | ||
}).map(|_| ()); | ||
{ |
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.
Import use crate::convert::TryInto;
only to this block.
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.
Done
@bors r- |
@bors: r+ |
📌 Commit 3adbf63 has been approved by |
Add an overflow check in truncate implementation for Unix. Closes rust-lang#63326. cc @alexcrichton
⌛ Testing commit 3adbf63 with merge 26e60ae9583e6110a4ddf9dbd37de1c919fdf4ce... |
@bors retry rolled up. |
Rollup of 8 pull requests Successful merges: - #63261 (bump rand in libcore/liballoc test suites) - #63316 (Update rustfmt to 1.4.4) - #63332 (Add an overflow check in truncate implementation for Unix.) - #63342 (Don't use remap-path-prefix in dep-info files.) - #63366 (doc: Fix typo in float from bytes methods) - #63370 (Fix ICE #63364) - #63377 (Improved documentation for compile_error!()) - #63379 (Add test for issue 53096) Failed merges: r? @ghost
☔ The latest upstream changes (presumably #63380) made this pull request unmergeable. Please resolve the merge conflicts. |
Closes #63326.
cc @alexcrichton