Re: [PATCH] Don't dereference NULL upon lookup_tree failure.
From: Jim Meyering <hidden>
Date: 2016-06-15 22:44:01
Junio C Hamano [off-list ref] wrote:
Jim Meyering [off-list ref] writes:quoted
Junio C Hamano [off-list ref] wrote: ...quoted
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.