summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa39b6b)
raw | patch | inline | side by side (parent: fa39b6b)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 22 Dec 2006 07:49:13 +0000 (23:49 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 22 Dec 2006 07:49:13 +0000 (23:49 -0800) |
We have a static allocation of MAXPARENT, but that limit was not
enforced, other than by a lucky invocation of the program segfaulting.
Signed-off-by: Junio C Hamano <junkio@cox.net>
enforced, other than by a lucky invocation of the program segfaulting.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-commit-tree.c | patch | blob | history |
diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c
index 856f3cd841818bdad4446b3f7b75d5ab22959788..bc28770664aac2c51bdd83125f36e2b15903535c 100644 (file)
--- a/builtin-commit-tree.c
+++ b/builtin-commit-tree.c
a = argv[i]; b = argv[i+1];
if (!b || strcmp(a, "-p"))
usage(commit_tree_usage);
+
+ if (parents >= MAXPARENT)
+ die("Too many parents (%d max)", MAXPARENT);
if (get_sha1(b, parent_sha1[parents]))
die("Not a valid object name %s", b);
check_valid(parent_sha1[parents], commit_type);