summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d07f6d)
raw | patch | inline | side by side (parent: 2d07f6d)
author | Erik Faye-Lund <kusmabite@gmail.com> | |
Mon, 23 Mar 2009 12:53:08 +0000 (12:53 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 30 Mar 2009 02:48:43 +0000 (19:48 -0700) |
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>
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>
builtin-fast-export.c | patch | blob | history | |
t/t9301-fast-export.sh | patch | blob | history |
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index 8a6cf5e6495755f26fb322ec578c53668cc8edba..1ec459f057a5b282d09f6a9bc030ee5210e7cb38 100644 (file)
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
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:
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 2e31f67465bcba4f565cb7233c0604f56568b878..b1f75ceea44cec925fd170ca5b1bdf19afa60fb3 100755 (executable)
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
'
# NEEDSWORK: not just check return status, but validate the output
-# two tests commented out due to crash and thus unreliable return code
-test_expect_failure 'tree_tag' 'git fast-export tree_tag'
-test_expect_failure 'tree_tag-obj' 'git fast-export tree_tag-obj'
+test_expect_success 'tree_tag' 'git fast-export tree_tag'
+test_expect_success 'tree_tag-obj' 'git fast-export tree_tag-obj'
test_expect_failure 'tag-obj_tag' 'git fast-export tag-obj_tag'
test_expect_failure 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'