Skip to content

Vector reverse overflow#4105

Merged
ethomson merged 2 commits intolibgit2:masterfrom
pks-t:pks/vector-reverse-overflow
Feb 2, 2017
Merged

Vector reverse overflow#4105
ethomson merged 2 commits intolibgit2:masterfrom
pks-t:pks/vector-reverse-overflow

Conversation

@pks-t
Copy link
Copy Markdown
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.

3 participants