mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-03 19:49:54 +00:00
ignore: there must be a repository
Otherwise we'll NULL-dereference in git_attr_cache__init
This commit is contained in:
parent
a6d833a29e
commit
8a349bf2a1
@ -278,7 +278,7 @@ int git_ignore__for_path(
|
||||
int error = 0;
|
||||
const char *workdir = git_repository_workdir(repo);
|
||||
|
||||
assert(ignores && path);
|
||||
assert(repo && ignores && path);
|
||||
|
||||
memset(ignores, 0, sizeof(*ignores));
|
||||
ignores->repo = repo;
|
||||
@ -503,9 +503,9 @@ int git_ignore_path_is_ignored(
|
||||
unsigned int i;
|
||||
git_attr_file *file;
|
||||
|
||||
assert(ignored && pathname);
|
||||
assert(repo && ignored && pathname);
|
||||
|
||||
workdir = repo ? git_repository_workdir(repo) : NULL;
|
||||
workdir = git_repository_workdir(repo);
|
||||
|
||||
memset(&path, 0, sizeof(path));
|
||||
memset(&ignores, 0, sizeof(ignores));
|
||||
|
Loading…
Reference in New Issue
Block a user