diff options
author | Brian Harring <ferringb@gmail.com> | 2011-08-24 09:47:17 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-24 21:50:33 +0400 |
commit | 2a74532412b9d87d4ad96dacbe9a31ff85f80af5 (patch) | |
tree | 26724af483011f1332dc399e031ed4d554325de8 | |
parent | 051e4005a37c4ebe8b8855e415e6c6969d68e1a3 (diff) |
get_indexed_object can return NULL if nothing is in that slot; check for it
This fixes a segfault introduced by 051e400; via it, no longer able to
trigger the http/smartserv race.
Signed-off-by: Brian Harring <ferringb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | upload-pack.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/upload-pack.c b/upload-pack.c index a9a6c0cb24..03adf28550 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -533,6 +533,8 @@ static void check_non_tip(void) namebuf[41] = '\n'; for (i = get_max_object_index(); 0 < i; ) { o = get_indexed_object(--i); + if (!o) + continue; if (!(o->flags & OUR_REF)) continue; memcpy(namebuf + 1, sha1_to_hex(o->sha1), 40); |