From: Lennart Poettering Date: Tue, 16 Jan 2024 22:24:04 +0000 (+0100) Subject: exec-credential: strv_extend() handles NULL strings gracefully X-Git-Tag: v256-rc1~1126^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F30974%2Fhead;p=thirdparty%2Fsystemd.git exec-credential: strv_extend() handles NULL strings gracefully --- diff --git a/src/core/exec-credential.c b/src/core/exec-credential.c index 4aa3e35bd85..41c0fce13b5 100644 --- a/src/core/exec-credential.c +++ b/src/core/exec-credential.c @@ -244,9 +244,8 @@ static char **credential_search_path(const ExecParameters *params, CredentialSea } if (IN_SET(path, CREDENTIAL_SEARCH_PATH_TRUSTED, CREDENTIAL_SEARCH_PATH_ALL)) { - if (params->received_credentials_directory) - if (strv_extend(&l, params->received_credentials_directory) < 0) - return NULL; + if (strv_extend(&l, params->received_credentials_directory) < 0) + return NULL; if (strv_extend_strv(&l, CONF_PATHS_STRV("credstore"), /* filter_duplicates= */ true) < 0) return NULL;