Skip to content

Commit 0dec30b

Browse files
Nicolas PitreJunio C Hamano
authored andcommitted
fix pack-object buffer size
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>
1 parent 7573193 commit 0dec30b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ static void setup_progress_signal(void)
12311231
int main(int argc, char **argv)
12321232
{
12331233
SHA_CTX ctx;
1234-
char line[PATH_MAX + 20];
1234+
char line[40 + 1 + PATH_MAX + 2];
12351235
int window = 10, depth = 10, pack_to_stdout = 0;
12361236
struct object_entry **list;
12371237
int num_preferred_base = 0;

0 commit comments

Comments
 (0)