From 2bed3553f4595a42d9a6884edc66b991e21f881e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 18 Apr 2014 00:34:04 +0200 Subject: [PATCH] cherry-pick: terminate the commit id string We treat this as a NUL-terminated string, so make sure that we add the terminator. --- src/cherrypick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cherrypick.c b/src/cherrypick.c index 67a2c6af3..6a5ca834c 100644 --- a/src/cherrypick.c +++ b/src/cherrypick.c @@ -187,7 +187,7 @@ int git_cherry_pick( goto on_error; } - git_oid_fmt(commit_oidstr, git_commit_id(commit)); + git_oid_nfmt(commit_oidstr, sizeof(commit_oidstr), git_commit_id(commit)); if ((error = write_merge_msg(repo, commit_msg)) < 0 || (error = git_buf_printf(&their_label, "%.7s... %s", commit_oidstr, commit_summary)) < 0 ||