Skip to content

Commit 2a74532

Browse files
ferringbgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 051e400 commit 2a74532

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

upload-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ static void check_non_tip(void)
533533
namebuf[41] = '\n';
534534
for (i = get_max_object_index(); 0 < i; ) {
535535
o = get_indexed_object(--i);
536+
if (!o)
537+
continue;
536538
if (!(o->flags & OUR_REF))
537539
continue;
538540
memcpy(namebuf + 1, sha1_to_hex(o->sha1), 40);

0 commit comments

Comments
 (0)