author | Junio C Hamano <gitster@pobox.com> | |
Fri, 14 Mar 2008 05:07:18 +0000 (22:07 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 14 Mar 2008 06:56:36 +0000 (23:56 -0700) | ||
commit | ca885a4fe6444bed840295378848904106c87c85 | |
tree | 77b671ab9b278745ef39f0286b155db871864afe | tree | snapshot |
parent | f746bae84e4746a861d9ebed29fd9255e5cd929f | commit | diff |
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 <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-read-tree.c | diff | blob | history | |
unpack-trees.c | diff | blob | history | |
unpack-trees.h | diff | blob | history |