diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-09-11 13:06:07 +0700 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2013-09-13 21:00:30 -0400 |
commit | c15490d3c07692cbfd65eb70ffc6ef8f116c809e (patch) | |
tree | 9ff1cd5bf6ef75758df50b9ac68f0f7a364a62e7 | |
parent | c1ed8b98702595ceb500c547ac48d1c081ccda5d (diff) | |
download | git-c15490d3c07692cbfd65eb70ffc6ef8f116c809e.tar.gz |
pack v4: lift dict size check in load_dict()
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 <pclouds@gmail.com>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
-rw-r--r-- | packv4-parse.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/packv4-parse.c b/packv4-parse.c index fe01de05a2..c3cf548b7f 100644 --- a/packv4-parse.c +++ b/packv4-parse.c @@ -89,10 +89,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); |