Browse Source

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

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 18 years ago
parent
commit
c7d68c8000
  1. 2
      builtin-fetch--tool.c

2
builtin-fetch--tool.c

@ -407,6 +407,8 @@ static int expand_refs_wildcard(const char *ls_remote_result, int numrefs, @@ -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;

Loading…
Cancel
Save