From b5b16990f8b074bd0481ced047b8f8bf66eee6dc Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 17 Feb 2006 16:14:52 -0800 Subject: Prevent git-upload-pack segfault if object cannot be found Signed-off-by: Carl Worth Signed-off-by: Junio C Hamano --- upload-pack.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'upload-pack.c') diff --git a/upload-pack.c b/upload-pack.c index d1980556ca..3606529f61 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -216,6 +216,9 @@ static int send_ref(const char *refname, const unsigned char *sha1) static char *capabilities = "multi_ack"; struct object *o = parse_object(sha1); + if (!o) + die("git-upload-pack: cannot find object %s:", sha1_to_hex(sha1)); + if (capabilities) packet_write(1, "%s %s%c%s\n", sha1_to_hex(sha1), refname, 0, capabilities); -- cgit v1.2.1