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>
This commit is contained in:
parent
1fa9bf362a
commit
1bb88be99e
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user