summaryrefslogtreecommitdiff
path: root/builtin-fetch--tool.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-27 23:51:48 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-27 23:51:48 -0800
commitc7d68c80002090bddc1eb740d83818aa0a08bbbe (patch)
tree72341efe1f82e4cabbe0c56bb0cb03506231dc26 /builtin-fetch--tool.c
parentdec56c8cf1da06fe9ff4c9d3a26f74fb1ddd2fc6 (diff)
downloadgit-c7d68c80002090bddc1eb740d83818aa0a08bbbe.tar.gz
builtin-fetch--tool: make sure not to overstep ls-remote-result buffer.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-fetch--tool.c')
-rw-r--r--builtin-fetch--tool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 5301c3cb78..eeee0a5ebf 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -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;