From: Aki Tuomi Date: Thu, 23 Jan 2020 08:44:28 +0000 (+0200) Subject: lib-program-client: Ensure set is not NULL in program_client_init X-Git-Tag: 2.3.10~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=494ff89c383a8d8fc4b5d51b3a16f57535c59967;p=thirdparty%2Fdovecot%2Fcore.git lib-program-client: Ensure set is not NULL in program_client_init Would cause crash otherwise. Found by coverity. --- diff --git a/src/lib-program-client/program-client.c b/src/lib-program-client/program-client.c index 05a0cc6115..cb45445cd5 100644 --- a/src/lib-program-client/program-client.c +++ b/src/lib-program-client/program-client.c @@ -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");