builtin-fast-export.c: fix crash on tagged trees

If a tag object points to a tree (or another unhandled type), the commit-
pointer is left uninitialized and later dereferenced. This patch adds a
default case to the switch that issues a warning and skips the object.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Erik Faye-Lund
2009-03-23 12:53:08 +00:00
committed by Junio C Hamano
parent 2d07f6d4b7
commit c0582c53bc
2 changed files with 6 additions and 3 deletions

View File

@ -375,6 +375,10 @@ static void get_tags_and_duplicates(struct object_array *pending,
case OBJ_BLOB:
handle_object(tag->object.sha1);
continue;
default:
warning("Tag points to object of unexpected type %s, skipping.",
typename(tag->object.type));
continue;
}
break;
default: