Skip to content

Commit 1a11be4

Browse files
committed
store_plugin: avoid potential NULL deref in boolean context
Coverity CID 330466
1 parent 4833ac0 commit 1a11be4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

plugins/sudoers/defaults.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,10 @@ store_plugin(const char *str, struct sudo_defs_types *def, int op)
10941094
if (op == false || op == true)
10951095
(void)list_op(NULL, 0, &def->sd_un.list, freeall);
10961096

1097-
if (!list_op(str, strlen(str), &def->sd_un.list, lop))
1098-
debug_return_bool(false);
1097+
if (str != NULL) {
1098+
if (!list_op(str, strlen(str), &def->sd_un.list, lop))
1099+
debug_return_bool(false);
1100+
}
10991101

11001102
debug_return_bool(true);
11011103
}

0 commit comments

Comments
 (0)