]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
exec-credential: strv_extend() handles NULL strings gracefully 30974/head
authorLennart Poettering <lennart@poettering.net>
Tue, 16 Jan 2024 22:24:04 +0000 (23:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Jan 2024 10:32:11 +0000 (11:32 +0100)
src/core/exec-credential.c

index 4aa3e35bd85bdff7ee564e6d2c09ecf86e21b274..41c0fce13b5ebe8ae575c247f2fe73bb46be26ba 100644 (file)
@@ -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;