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

Vector reverse overflow #4105

Merged
merged 2 commits into from Feb 2, 2017
Merged

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Feb 2, 2017

This fixes PR #4102

adamniedzielski and others added 2 commits February 2, 2017 16:01
The code reversing a vector initially determines the rear-pointer by
simply subtracting 1 from the vector's length. Obviously, this fails if
the vector is empty, in which case we have an integer overflow.

Fix the issue by returning early if the vector is empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants