git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 10 in “Don't dereference NULL upon lookup_tree failure.”
  1. Don't dereference NULL upon lookup_tree failure.Jim Meyering, Dec 21, 2007
  2. Junio C HamanoDec 21, 2007
  3. Jim MeyeringDec 21, 2007
  4. Junio C HamanoDec 21, 2007
  5. Jim MeyeringDec 21, 2007
  6. Junio C HamanoDec 21, 2007
  7. Jim MeyeringDec 22, 2007
  8. Junio C HamanoDec 22, 2007
  9. Jim MeyeringDec 22, 2007
  10. Junio C HamanoDec 22, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.