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:
committed by
Junio C Hamano
parent
2d07f6d4b7
commit
c0582c53bc
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user