Skip to content

Commit

Permalink
Fix off-by-one in oid_array_remove
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Mar 5, 2019
1 parent f529e57 commit 1550c45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/cinnabar-fast-import.c
Expand Up @@ -337,7 +337,7 @@ static void oid_array_insert(struct oid_array *array, int index,
static void oid_array_remove(struct oid_array *array, int index)
{
memmove(&array->oid[index], &array->oid[index+1],
sizeof(array->oid[0]) * (array->nr-- - index));
sizeof(array->oid[0]) * (--array->nr - index));
}

void ensure_heads(struct oid_array *heads)
Expand Down

0 comments on commit 1550c45

Please sign in to comment.