diff options
| author | Patrick Steinhardt <ps@pks.im> | 2017-02-02 16:02:57 +0100 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2017-02-02 16:02:57 +0100 |
| commit | f47db3c799b4f6b63ee8021e0c93d00d5f125c9a (patch) | |
| tree | 13032bb761d44cb136b4a75cf2df3938ff41302b /include/git2/revert.h | |
| parent | 390431c322b3badf7850a5653c8a126c30f95deb (diff) | |
| download | libgit2-f47db3c799b4f6b63ee8021e0c93d00d5f125c9a.tar.gz | |
vector: do not reverse a vector if it is empty
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.
Diffstat (limited to 'include/git2/revert.h')
0 files changed, 0 insertions, 0 deletions
