Skip to content

Commit

Permalink
reduce delta head inflated size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Oct 19, 2006
1 parent e0b0830 commit 1a3b55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ static int packed_delta_info(struct packed_git *p,

if (sizep) {
const unsigned char *data;
unsigned char delta_head[64];
unsigned char delta_head[20];
unsigned long result_size;
z_stream stream;
int st;
Expand Down

0 comments on commit 1a3b55c

Please sign in to comment.