Merge pull request #4105 from pks-t/pks/vector-reverse-overflow

Vector reverse overflow
This commit is contained in:
Edward Thomson 2017-02-02 17:21:23 +01:00 committed by GitHub
commit 104a1b0bd9
2 changed files with 17 additions and 0 deletions

View File

@ -406,6 +406,9 @@ void git_vector_reverse(git_vector *v)
{
size_t a, b;
if (v->length == 0)
return;
a = 0;
b = v->length - 1;

View File

@ -331,6 +331,20 @@ void test_revwalk_basic__hide_then_push(void)
cl_assert_equal_i(i, 0);
}
void test_revwalk_basic__topo_crash(void)
{
git_oid oid;
git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644");
revwalk_basic_setup_walk(NULL);
git_revwalk_sorting(_walk, GIT_SORT_TOPOLOGICAL);
cl_git_pass(git_revwalk_push(_walk, &oid));
cl_git_pass(git_revwalk_hide(_walk, &oid));
git_revwalk_next(&oid, _walk);
}
void test_revwalk_basic__push_range(void)
{
revwalk_basic_setup_walk(NULL);