2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

store_plugin: avoid potential NULL deref in boolean context

Coverity CID 330466
This commit is contained in:
Todd C. Miller
2023-11-02 14:26:44 -06:00
parent 4833ac0f01
commit 1a11be4d9f

View File

@@ -1094,8 +1094,10 @@ store_plugin(const char *str, struct sudo_defs_types *def, int op)
if (op == false || op == true)
(void)list_op(NULL, 0, &def->sd_un.list, freeall);
if (!list_op(str, strlen(str), &def->sd_un.list, lop))
debug_return_bool(false);
if (str != NULL) {
if (!list_op(str, strlen(str), &def->sd_un.list, lop))
debug_return_bool(false);
}
debug_return_bool(true);
}