From 494ff89c383a8d8fc4b5d51b3a16f57535c59967 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 23 Jan 2020 10:44:28 +0200 Subject: [PATCH] lib-program-client: Ensure set is not NULL in program_client_init Would cause crash otherwise. Found by coverity. --- src/lib-program-client/program-client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); -- 2.47.3