]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: Ensure set is not NULL in program_client_init
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 23 Jan 2020 08:44:28 +0000 (10:44 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 5 Feb 2020 12:10:32 +0000 (12:10 +0000)
Would cause crash otherwise.

Found by coverity.

src/lib-program-client/program-client.c

index 05a0cc611562dcc659fda02cd1c2285748b51924..cb45445cd5644b22430e1981edcf00b6ffa12cf0 100644 (file)
@@ -463,6 +463,7 @@ void program_client_init(struct program_client *pclient, pool_t pool,
                         const char *initial_label, const char *const *args,
                         const struct program_client_settings *set)
 {
+       i_assert(set != NULL);
        pclient->pool = pool;
        if (args != NULL)
                pclient->args = p_strarray_dup(pool, args);
@@ -472,7 +473,7 @@ void program_client_init(struct program_client *pclient, pool_t pool,
        pclient->fd_out = -1;
 
        pclient->event = event_create(set->event);
-       event_set_forced_debug(pclient->event, (set != NULL && set->debug));
+       event_set_forced_debug(pclient->event, set->debug);
        program_client_set_label(pclient, initial_label);
 
        e_debug(pclient->event, "Created");