[PATCH] reduce delta head inflated size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>

---

diff --git a/sha1_file.c b/sha1_file.c
index 25c0bf9..e89d24c 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -943,7 +943,7 @@ static int packed_delta_info(struct pack
 
 	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;
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]