Commit ce72e399d26a7b246f6425657b0c8a55d40159c9

nulltoken 2013-05-05T16:45:38

commit: guard create() against not owned trees

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/commit.c b/src/commit.c
index 46c02c2..aec3e1e 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -149,6 +149,7 @@ int git_commit_create(
 	const git_oid **parent_oids;
 
 	assert(parent_count >= 0);
+	assert(git_object_owner((const git_object *)tree) == repo);
 
 	parent_oids = git__malloc(parent_count * sizeof(git_oid *));
 	GITERR_CHECK_ALLOC(parent_oids);