From c96ee6159b4c119076fdad7cca562c0dc837d789 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 18 Jun 2015 08:09:27 -0700 Subject: [PATCH] Fix potential crash if the existing filename is NULL Should have used same_string() anyway... Signed-off-by: Dirk Hohndel --- save-git.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); }