mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 11:20:59 +00:00
don't walk off the end of the index
This commit is contained in:
parent
6cacd44bd0
commit
e759b07217
@ -957,13 +957,14 @@ int git_index_conflict_remove(git_index *index, const char *path)
|
||||
continue;
|
||||
}
|
||||
|
||||
error = git_vector_remove(&index->entries, (unsigned int)pos);
|
||||
if ((error = git_vector_remove(&index->entries, (unsigned int)pos)) < 0)
|
||||
return error;
|
||||
|
||||
if (error >= 0)
|
||||
index_entry_free(conflict_entry);
|
||||
index_entry_free(conflict_entry);
|
||||
posmax--;
|
||||
}
|
||||
|
||||
return error;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int index_conflicts_match(const git_vector *v, size_t idx)
|
||||
|
Loading…
Reference in New Issue
Block a user