Skip to content

Commit

Permalink
get_indexed_object can return NULL if nothing is in that slot; check …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Brian Harring authored and Junio C Hamano committed Aug 24, 2011
1 parent 051e400 commit 2a74532
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2a74532

Please sign in to comment.