From: Jim Meyering Date: Sat, 22 Dec 2007 00:15:15 GMT Subject: Re: [PATCH] Don't dereference NULL upon lookup_tree failure. Message-ID: <8763yrvb3g.fsf@rho.meyering.net> In-Reply-To: <7vve6r39bp.fsf@gitster.siamese.dyndns.org> Junio C Hamano wrote: > Jim Meyering writes: > >> Junio C Hamano 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.