Subject: [PATCH 06/21] pack v4: lift dict size check in load_dict()

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Wed, 11 Sep 2013 13:06:07 +0700

A pack with no trees (or an empty pack) could have zero-sized name
dictionary.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 packv4-parse.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/packv4-parse.c b/packv4-parse.c
index f96acc1..80ad6fc 100644
--- a/packv4-parse.c
+++ b/packv4-parse.c
@@ -87,10 +87,6 @@ static struct packv4_dict *load_dict(struct packed_git *p, off_t *offset)
 	src = use_pack(p, &w_curs, curpos, &avail);
 	cp = src;
 	dict_size = decode_varint(&cp);
-	if (dict_size < 3) {
-		error("bad dict size");
-		return NULL;
-	}
 	curpos += cp - src;
 
 	data = xmallocz(dict_size);
-- 
1.8.2.82.gc24b958