git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Erik Faye-Lund <kusmabite@gmail.com>
Cc: git@vger.kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	"Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo
Date: Sat, 21 Mar 2009 16:54:06 -0700	[thread overview]
Message-ID: <7vd4cabffl.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1237675051-6688-1-git-send-email-kusmabite@gmail.com> (Erik Faye-Lund's message of "Sat, 21 Mar 2009 22:37:31 +0000")

Erik Faye-Lund <kusmabite@gmail.com> writes:

> This small issue was discovered by Benjamin Kramers Clang-runs on the
> git code-base. If a tag object points to an object that is not a commit
> or a blob, an invalid pointer is dereferenced in the code that followed.

A tag can point at anything, so this is not an issue about "crash on a
_corrupt_ repository".

I am not very familiar with this program, but the codepath involved should
be prepared to _see_ any type of object instead of dying.

What to do after _seeing_ a type of object is a different matter.  It
appears that there is no way to feed a tree object to fast-import, but I
think the fast-import language can represent a tag that points at another
tag just fine.  So the best you can do is perhaps to issue a warning
"skipping a tag that points at a tree object" and impoement a proper
handling of a tag that points at a tag.

  reply	other threads:[~2009-03-21 23:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-21 22:37 [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo Erik Faye-Lund
2009-03-21 23:54 ` Junio C Hamano [this message]
2009-03-22 12:22   ` Erik Faye-Lund
2009-03-22 12:32     ` Erik Faye-Lund
2009-03-22 21:58     ` Junio C Hamano
2009-03-23  0:26   ` Shawn O. Pearce

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=7vd4cabffl.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=kusmabite@gmail.com \
    --cc=spearce@spearce.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).