Skip to content

Commit

Permalink
git-blame: Fix overrun in fake_working_tree_commit()
Browse files Browse the repository at this point in the history
git-blame would overflow commit->buffer when annotating files with long paths.

Signed-off-by: Michael Spang <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Michael Spang authored and Junio C Hamano committed Apr 15, 2007
1 parent 1fa9bf3 commit 1bb88be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1bb88be

Please sign in to comment.