mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Avoid possible NULL dereference
I actually think this might be a false positive, but the libgit2 API doesn't appear to guarantee that ancestor is not NULL, so let's add that check. Coverity CID 1325296 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a51903fbb6
commit
dd58402ef3
1 changed files with 1 additions and 1 deletions
|
@ -329,7 +329,7 @@ static int try_to_git_merge(git_repository *repo, git_reference *local, git_refe
|
|||
// the file was removed on one side or the other - just remove it
|
||||
fprintf(stderr, "looks like a delete on one side; removing the file from the index\n");
|
||||
error = git_index_remove(merged_index, ours ? ours->path : theirs->path, GIT_INDEX_STAGE_ANY);
|
||||
} else {
|
||||
} else if (ancestor) {
|
||||
error = git_index_conflict_remove(merged_index, ours ? ours->path : theirs ? theirs->path : ancestor->path);
|
||||
}
|
||||
if (error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue