git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Harring <ferringb@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it
Date: Tue, 23 Aug 2011 22:47:17 -0700	[thread overview]
Message-ID: <20110824054717.GA16512@localhost> (raw)

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>
---
 upload-pack.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/upload-pack.c b/upload-pack.c
index 6420918..8739bfa 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);
-- 
1.7.6

             reply	other threads:[~2011-08-24  5:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  5:47 Brian Harring [this message]
2011-08-24 17:54 ` [PATCH] get_indexed_object can return NULL if nothing is in that slot; check for it Junio C Hamano
2011-08-24 20:40   ` Brian Harring
2011-08-24 21:10     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110824054717.GA16512@localhost \
    --to=ferringb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).