Skip to content

Commit b2640c3

Browse files
committed
config: add asserts for non-null parameters in lock/unlock
1 parent de2af3c commit b2640c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/config.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,8 @@ int git_config_lock(git_transaction **out, git_config *cfg)
11821182
git_config_backend *backend;
11831183
backend_internal *internal;
11841184

1185+
assert(cfg);
1186+
11851187
internal = git_vector_get(&cfg->backends, 0);
11861188
if (!internal || !internal->backend) {
11871189
giterr_set(GITERR_CONFIG, "cannot lock; the config has no backends");
@@ -1200,6 +1202,8 @@ int git_config_unlock(git_config *cfg, int commit)
12001202
git_config_backend *backend;
12011203
backend_internal *internal;
12021204

1205+
assert(cfg);
1206+
12031207
internal = git_vector_get(&cfg->backends, 0);
12041208
if (!internal || !internal->backend) {
12051209
giterr_set(GITERR_CONFIG, "cannot lock; the config has no backends");

0 commit comments

Comments
 (0)