Re: New NULL dereference in sequence.c
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- May 2, 2012, 17:39 UTC
- Message-ID
- <vpqd36mcwjc.fsf@bauges.imag.fr>
- In-Reply-To
- <20120502173436.GA26732@hmsreliant.think-freely.org>
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/