Subject: Re: [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo

From: Junio C Hamano <[email-masked]>
Date: Sat, 21 Mar 2009 16:54:06 -0700

Erik Faye-Lund <[email-masked]> 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.