git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-blame: Fix overrun in fake_working_tree_commit()
@ 2007-04-14 21:26 Michael Spang
  0 siblings, 0 replies; only message in thread
From: Michael Spang @ 2007-04-14 21:26 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

git-blame would overflow commit->buffer when annotating files with long paths.

Signed-off-by: Michael Spang <mspang@uwaterloo.ca>
---
 builtin-blame.c |    2 +-
 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"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-14 21:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-14 21:26 [PATCH] git-blame: Fix overrun in fake_working_tree_commit() Michael Spang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).