public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
To: Neil Horman <nhorman@tuxdriver•com>
Cc: "René Scharfe" <rene.scharfe@lsrfire•ath.cx>,
	"Michael Mueller" <mmueller@vigilantsw•com>,
	git@vger•kernel.org
Subject: Re: New NULL dereference in sequence.c
Date: Wed, 02 May 2012 19:39:19 +0200	[thread overview]
Message-ID: <vpqd36mcwjc.fsf@bauges.imag.fr> (raw)
In-Reply-To: <20120502173436.GA26732@hmsreliant.think-freely.org> (Neil Horman's message of "Wed, 2 May 2012 13:34:36 -0400")

Neil Horman <nhorman@tuxdriver•com> writes:

>> >         if (!head_commit || parse_commit(head_commit))
>> >             return error(_("could not parse commit %s\n"),
>> >                      sha1_to_hex(head_commit->object.sha1));

[...]

> Have you actually seen this problem occur? It seems to me that the
> only way head_commit could be NULL is in the event that HEAD wasn't a
> commit object, whcih I don't think can be the case unless something
> else is very wrong with your tree.

I don't know whether it can actually happen, but if it can't happen,
then the if() condition should be rewritten. As it is, it explicitly
allows head_commit to be NULL within the if body.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2012-05-02 17:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02  8:45 New NULL dereference in sequence.c Michael Mueller
2012-05-02 12:53 ` René Scharfe
2012-05-02 17:34   ` Neil Horman
2012-05-02 17:39     ` Matthieu Moy [this message]
2012-05-02 19:38       ` Neil Horman

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=vpqd36mcwjc.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp$(echo .)fr \
    --cc=git@vger$(echo .)kernel.org \
    --cc=mmueller@vigilantsw$(echo .)com \
    --cc=nhorman@tuxdriver$(echo .)com \
    --cc=rene.scharfe@lsrfire$(echo .)ath.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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