Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[stable] std: Check for overflow in `str::repeat` #54397
Conversation
alexcrichton
requested a review
from
Mark-Simulacrum
Sep 20, 2018
This comment has been minimized.
This comment has been minimized.
This was referenced Sep 20, 2018
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
Mark-Simulacrum
Sep 20, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors: r+ |
This comment has been minimized.
This comment has been minimized.
|
|
bors
added
the
S-waiting-on-bors
label
Sep 20, 2018
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Sep 20, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 1b94b84
into
rust-lang:stable
Sep 20, 2018
fbstj
referenced this pull request
Sep 20, 2018
Closed
highfive doesn't warn on old-released pulls #169
alexcrichton
deleted the
alexcrichton:fix-bug-stable
branch
Sep 21, 2018
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Sep 25, 2018
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Sep 25, 2018
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Sep 25, 2018
alexcrichton
referenced this pull request
Sep 25, 2018
Merged
[beta] Add 1.29.1 release nodes #54565
bors
added a commit
that referenced
this pull request
Sep 27, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Sep 27, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Sep 29, 2018
Shnatsel
referenced this pull request
Jan 14, 2019
Open
Continuous verification of standard library #23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
alexcrichton commentedSep 20, 2018
This commit fixes a buffer overflow issue in the standard library
discovered by Scott McMurray where if a large number was passed to
str::repeatit may cause and out of bounds write to the buffer of aVec.This bug was accidentally introduced in #48657 when optimizing the
str::repeatfunction. The bug affects stable Rust releases 1.26.0 to1.29.0. We plan on backporting this fix to create a 1.29.1 release, and
the 1.30.0 release onwards will include this fix.
The fix in this commit is to introduce a deterministic panic in the case of
capacity overflow. When repeating a slice where the resulting length is larger
than the address space, there’s no way it can succeed anyway!
The standard library and surrounding libraries were briefly checked to see if
there were othere instances of preallocating a vector with a calculation that
may overflow. No instances of this bug (out of bounds write due to a calculation
overflow) were found at this time.
Note that this commit is the first steps towards fixing this issue,
we'll be making a formal post to the Rust security list once these
commits have been merged.