Skip to content

Commit 5c0c8fd

Browse files
committed
repository: assert that we're passed a valid head pointer
1 parent 814e7ac commit 5c0c8fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/repository.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,8 @@ int git_repository_head(git_reference **head_out, git_repository *repo)
21232123
git_reference *head;
21242124
int error;
21252125

2126+
assert(head_out);
2127+
21262128
if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0)
21272129
return error;
21282130

0 commit comments

Comments
 (0)