Skip to content

Commit

Permalink
fix pack-object buffer size
Browse files Browse the repository at this point in the history
The input line has 40 _chars_ of sha1 and no 20 _bytes_. It should also
account for the space before the pathname, and the terminating \n and \0.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Apr 21, 2006
1 parent 7573193 commit 0dec30b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ static void setup_progress_signal(void)
int main(int argc, char **argv)
{
SHA_CTX ctx;
char line[PATH_MAX + 20];
char line[40 + 1 + PATH_MAX + 2];
int window = 10, depth = 10, pack_to_stdout = 0;
struct object_entry **list;
int num_preferred_base = 0;
Expand Down

0 comments on commit 0dec30b

Please sign in to comment.