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

Use checked_sub to avoid index out of bounds #5129

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

JohnTitor
Copy link
Member

@JohnTitor JohnTitor commented Feb 3, 2020

(Fixes) #4681 (possibly)

The issue likely occurs due to lit_snip.len() < suffix.len() + 1. You can see similar backtrace to change it to lit_snip.len() - suffix.len() - 1000 or something then run cargo test --release.
But I couldn't come up with the test so I'd leave the issue open if we want.

changelog: Fix potential ICE in misc_early

@JohnTitor JohnTitor added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 3, 2020
@flip1995
Copy link
Member

flip1995 commented Feb 3, 2020

@bors r+

Let's leave the issue open and ping @arturoc to test it, once it lands in nightly. This change is an improvement either way.

@bors
Copy link
Collaborator

bors commented Feb 3, 2020

📌 Commit bae129a has been approved by flip1995

@bors
Copy link
Collaborator

bors commented Feb 3, 2020

⌛ Testing commit bae129a with merge a395894...

bors added a commit that referenced this pull request Feb 3, 2020
Use `checked_sub` to avoid index out of bounds

(Fixes) #4681 (possibly)

The issue likely occurs due to `lit_snip.len() < suffix.len() + 1`. You can see similar backtrace to change it to `lit_snip.len() - suffix.len() - 1000` or something then run `cargo test --release`.
But I couldn't come up with the test so I'd leave the issue open if we want.

changelog: Fix potential ICE in `misc_early`
@bors
Copy link
Collaborator

bors commented Feb 3, 2020

☀️ Test successful - checks-travis, status-appveyor
Approved by: flip1995
Pushing a395894 to master...

@bors bors merged commit bae129a into rust-lang:master Feb 3, 2020
@JohnTitor JohnTitor deleted the use-checked-sub branch February 3, 2020 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants