From ca885a4fe6444bed840295378848904106c87c85 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 13 Mar 2008 22:07:18 -0700 Subject: read-tree() and unpack_trees(): use consistent limit read-tree -m can read up to MAX_TREES, which was arbitrarily set to 8 since August 2007 (4 is needed to deal with 2 merge-base case). However, the updated unpack_trees() code had an advertised limit of 4 (which it enforced). In reality the code was prepared to take only 3 trees and giving 4 caused it to stomp on its stack. Rename the MAX_TREES constant to MAX_UNPACK_TREES, move it to the unpack-trees.h common header file, and use it from both places to avoid future confusion. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- unpack-trees.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'unpack-trees.h') diff --git a/unpack-trees.h b/unpack-trees.h index e8abbcd03..50453ed20 100644 --- a/unpack-trees.h +++ b/unpack-trees.h @@ -1,6 +1,8 @@ #ifndef UNPACK_TREES_H #define UNPACK_TREES_H +#define MAX_UNPACK_TREES 8 + struct unpack_trees_options; typedef int (*merge_fn_t)(struct cache_entry **src, -- cgit v1.2.1