summaryrefslogtreecommitdiffstats
path: root/save-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-18 08:09:27 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-18 08:09:27 -0700
commitc96ee6159b4c119076fdad7cca562c0dc837d789 (patch)
tree051d5d848c101168742132985b5c1a937e107811 /save-git.c
parentb63b656c1fa2414fc9d24d3e52448f4d246f3697 (diff)
downloadsubsurface-c96ee6159b4c119076fdad7cca562c0dc837d789.tar.gz
Fix potential crash if the existing filename is NULL
Should have used same_string() anyway... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
-rw-r--r--save-git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/save-git.c b/save-git.c
index 3f540eab9..f4abcb080 100644
--- a/save-git.c
+++ b/save-git.c
@@ -1052,7 +1052,7 @@ static int create_new_commit(git_repository *repo, const char *remote, const cha
const git_oid *id = git_commit_id((const git_commit *) parent);
/* if we are saving to the same git tree we got this from, let's make
* sure there is no confusion */
- if (!strcmp(existing_filename, remote) && git_oid_strcmp(id, saved_git_id))
+ if (same_string(existing_filename, remote) && git_oid_strcmp(id, saved_git_id))
return report_error("The git branch does not match the git parent of the source");
}