summaryrefslogtreecommitdiff
path: root/builtin-blame.c
diff options
context:
space:
mode:
authorMichael Spang <mspang@uwaterloo.ca>2007-04-14 21:26:20 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-04-15 00:37:28 (GMT)
commit1bb88be99e4fdedcd5cc5292c11b566a00028deb (patch)
tree057f728336657c27f946d9d8133c72f6e7d28bcc /builtin-blame.c
parent1fa9bf362acbe2c939c246684ab0fe59aec74ba8 (diff)
downloadgit-1bb88be99e4fdedcd5cc5292c11b566a00028deb.zip
git-1bb88be99e4fdedcd5cc5292c11b566a00028deb.tar.gz
git-1bb88be99e4fdedcd5cc5292c11b566a00028deb.tar.bz2
git-blame: Fix overrun in fake_working_tree_commit()
git-blame would overflow commit->buffer when annotating files with long paths. Signed-off-by: Michael Spang <mspang@uwaterloo.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-blame.c')
-rw-r--r--builtin-blame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-blame.c b/builtin-blame.c
index 60ec535..bc86bda 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2041,7 +2041,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
commit->buffer = xmalloc(400);
ident = fmt_ident("Not Committed Yet", "not.committed.yet", NULL, 0);
- sprintf(commit->buffer,
+ snprintf(commit->buffer, 400,
"tree 0000000000000000000000000000000000000000\n"
"parent %s\n"
"author %s\n"