Merge branch 'tb/commit-graph-harden'
The code to parse and use the commit-graph file has been made more robust against corrupted input. * tb/commit-graph-harden: commit-graph.c: handle corrupt/missing trees commit-graph.c: handle commit parsing errors t/t5318: introduce failing 'git commit-graph write' tests
This commit is contained in:
3
commit.c
3
commit.c
@ -358,7 +358,8 @@ struct tree *repo_get_commit_tree(struct repository *r,
|
||||
|
||||
struct object_id *get_commit_tree_oid(const struct commit *commit)
|
||||
{
|
||||
return &get_commit_tree(commit)->object.oid;
|
||||
struct tree *tree = get_commit_tree(commit);
|
||||
return tree ? &tree->object.oid : NULL;
|
||||
}
|
||||
|
||||
void release_commit_memory(struct parsed_object_pool *pool, struct commit *c)
|
||||
|
Reference in New Issue
Block a user