Skip to content

Commit 1a3b55c

Browse files
Nicolas PitreJunio C Hamano
authored andcommitted
reduce delta head inflated size
Supposing that both the base and result sizes were both full size 64-bit values, their encoding would occupy only 9.2 bytes each. Therefore inflating 64 bytes is way overkill. Limit it to 20 bytes instead which should be plenty enough for a couple years to come. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent e0b0830 commit 1a3b55c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ static int packed_delta_info(struct packed_git *p,
908908

909909
if (sizep) {
910910
const unsigned char *data;
911-
unsigned char delta_head[64];
911+
unsigned char delta_head[20];
912912
unsigned long result_size;
913913
z_stream stream;
914914
int st;

0 commit comments

Comments
 (0)