From: Nguyễn Thái Ngọc Duy Date: Wed, 11 Sep 2013 06:06:05 GMT Subject: [PATCH 04/21] fixup! index-pack: parse v4 header and dictionaries Message-ID: <1378879582-15372-5-git-send-email-pclouds@gmail.com> In-Reply-To: <1378879582-15372-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- empty pack case builtin/index-pack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 8a6e2a3..89bc708 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -1474,7 +1474,8 @@ static void parse_dictionaries(void) return; sha1_table = xmalloc(20 * nr_objects_final); - hashcpy(sha1_table, fill_and_use(20)); + if (nr_objects_final) + hashcpy(sha1_table, fill_and_use(20)); for (i = 1; i < nr_objects_final; i++) { unsigned char *p = sha1_table + i * 20; hashcpy(p, fill_and_use(20)); -- 1.8.2.82.gc24b958