Re: [PATCH] Don't dereference NULL upon lookup_tree failure.
- From
Jim Meyering <jim@meyering.net>
- Date
- Dec 22, 2007, 00:15 UTC
- Message-ID
- <8763yrvb3g.fsf@rho.meyering.net>
- In-Reply-To
- <7vve6r39bp.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 22 quoted lines
> Jim Meyering <jim@meyering.net> writes: > >> Junio C Hamano <gitster@pobox.com> wrote: >> ... >>> Sorry, I asked for a wrong thing. parse_object() reads and >>> finds out the type, so type there is presumably the right type >>> of the object (which is OBJ_TREE). Then parse_object_buffer() >>> checks if it has already seen the object of the same SHA-1 and >>> finds that somebody had earlier told that SHA-1 name is of a >>> commit object. Either you found a SHA-1 collision (highly >>> unlikely) or the earlier caller had lied. And I think what >>> really needs to be fixed is that lying caller. That is not in >>> the above call chain. >> >> I presume that parsecvs is the culprit, in constructing >> an invalid repository... > > Independent of who creates a "invalid repository", our tools > should be prepared to be fed bad data and not get upset. > Somebody in our code read a non-commit (or it did not read > anything) and told the object layer it is a commit. That > codepath needs to be tightened up, no?
Yes, of course. Unfortunately, I won't have time to investigate for a while.