Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit ce72e39

Browse files
committed
commit: guard create() against not owned trees
1 parent dfec726 commit ce72e39

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/commit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ int git_commit_create(
149149
const git_oid **parent_oids;
150150

151151
assert(parent_count >= 0);
152+
assert(git_object_owner((const git_object *)tree) == repo);
152153

153154
parent_oids = git__malloc(parent_count * sizeof(git_oid *));
154155
GITERR_CHECK_ALLOC(parent_oids);

0 commit comments

Comments
 (0)