diff options
author | Erik Faye-Lund <kusmabite@gmail.com> | 2009-03-23 13:53:08 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-30 04:48:43 +0200 |
commit | c0582c53bcf4e83bba70e1ad23abbad31f96ebc8 (patch) | |
tree | bd5a8222f3352aba250a1777a764ccffc194e330 /builtin-fast-export.c | |
parent | builtin-fast-export.c: turn error into warning (diff) | |
download | git-c0582c53bcf4e83bba70e1ad23abbad31f96ebc8.tar.xz git-c0582c53bcf4e83bba70e1ad23abbad31f96ebc8.zip |
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>
Diffstat (limited to 'builtin-fast-export.c')
-rw-r--r-- | builtin-fast-export.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin-fast-export.c b/builtin-fast-export.c index 8a6cf5e649..1ec459f057 100644 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -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: |