From 68be2fea50e7a34c0e5f9fdf6adb9040c8df197f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 16 Nov 2011 22:04:13 -0800 Subject: receive-pack, fetch-pack: reject bogus pack that records objects twice When receive-pack & fetch-pack are run and store the pack obtained over the wire to a local repository, they internally run the index-pack command with the --strict option. Make sure that we reject incoming packfile that records objects twice to avoid spreading such a damage. Signed-off-by: Junio C Hamano --- object.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'object.c') diff --git a/object.c b/object.c index 31976b5d7..d8d09f92a 100644 --- a/object.c +++ b/object.c @@ -149,6 +149,8 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t struct tree *tree = lookup_tree(sha1); if (tree) { obj = &tree->object; + if (!tree->buffer) + tree->object.parsed = 0; if (!tree->object.parsed) { if (parse_tree_buffer(tree, buffer, size)) return NULL; -- cgit v1.2.1