builtin-fetch--tool: make sure not to overstep ls-remote-result buffer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2007-02-27 23:51:48 -08:00
parent dec56c8cf1
commit c7d68c8000

View file

@ -407,6 +407,8 @@ static int expand_refs_wildcard(const char *ls_remote_result, int numrefs,
eol = !next ? (ls + strlen(ls)) : next;
if (!memcmp("^{}", eol-3, 3))
continue;
if (eol - ls < 40)
continue;
if (get_sha1_hex(ls, sha1))
continue;
ls += 40;