Skip to content
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

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

marmistrz
Copy link
Contributor

Closes #63326.
cc @alexcrichton

Verified

This commit was signed with the committer’s verified signature. The key has expired.
marmistrz Marcin Mielniczuk
@rust-highfive
Copy link
Collaborator

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 6, 2019
@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Aug 7, 2019

📌 Commit 3cd9f3f has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Aug 7, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add an overflow check in truncate implementation for Unix.

Closes rust-lang#63326.
cc @alexcrichton
Copy link
Contributor

@tesuji tesuji left a 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(|_| ());
{
Copy link
Contributor

@tesuji tesuji Aug 8, 2019

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Centril
Copy link
Contributor

Centril commented Aug 8, 2019

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 8, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
marmistrz Marcin Mielniczuk
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 8, 2019

📌 Commit 3adbf63 has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 8, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 8, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add an overflow check in truncate implementation for Unix.

Closes rust-lang#63326.
cc @alexcrichton
@bors
Copy link
Contributor

bors commented Aug 8, 2019

⌛ Testing commit 3adbf63 with merge 26e60ae9583e6110a4ddf9dbd37de1c919fdf4ce...

@Centril
Copy link
Contributor

Centril commented Aug 8, 2019

@bors retry rolled up.

bors added a commit that referenced this pull request Aug 8, 2019
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
@bors bors merged commit 3adbf63 into rust-lang:master Aug 8, 2019
@bors
Copy link
Contributor

bors commented Aug 8, 2019

☔ The latest upstream changes (presumably #63380) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 8, 2019
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File::set_len uses an unsafe cast on Unix
7 participants