All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Meyering <jim@meyering.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git list <git@vger.kernel.org>,
	Matthew Farrellee <mfarrellee@redhat.com>
Subject: Re: [PATCH] Don't dereference NULL upon lookup_tree failure.
Date: Sat, 22 Dec 2007 01:15:15 +0100	[thread overview]
Message-ID: <8763yrvb3g.fsf@rho.meyering.net> (raw)
In-Reply-To: <7vve6r39bp.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 21 Dec 2007 15:40:58 -0800")

Junio C Hamano <gitster@pobox.com> wrote:

> 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.

  reply	other threads:[~2007-12-22  0:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21 22:32 [PATCH] Don't dereference NULL upon lookup_tree failure Jim Meyering
2007-12-21 22:48 ` Junio C Hamano
2007-12-21 22:54   ` Jim Meyering
2007-12-21 23:25     ` Junio C Hamano
2007-12-21 23:33       ` Jim Meyering
2007-12-21 23:40         ` Junio C Hamano
2007-12-22  0:15           ` Jim Meyering [this message]
2007-12-22  9:25             ` Junio C Hamano
2007-12-22 13:41               ` Jim Meyering
2007-12-22 18:32                 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8763yrvb3g.fsf@rho.meyering.net \
    --to=jim@meyering.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mfarrellee@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.