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

Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 5301c3c..eeee0a5 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -407,6 +407,8 @@
 			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;