From: Stephan Bosch Date: Sun, 18 Apr 2021 10:33:01 +0000 (+0200) Subject: lib-smtp: smtp-server-cmd-helo - Fix crash occurring upon pipelined EHLO with invalid... X-Git-Tag: 2.3.18~254 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=860e5e3a836ac656ae10a614e009506cae31fb44;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-server-cmd-helo - Fix crash occurring upon pipelined EHLO with invalid domain. Failed to check for NULL in domain value for a pipelined EHLO/HELO command. --- diff --git a/src/lib-smtp/smtp-server-cmd-helo.c b/src/lib-smtp/smtp-server-cmd-helo.c index a9666e4002..f1f908a82b 100644 --- a/src/lib-smtp/smtp-server-cmd-helo.c +++ b/src/lib-smtp/smtp-server-cmd-helo.c @@ -41,8 +41,7 @@ cmd_helo_next(struct smtp_server_cmd_ctx *cmd, { struct smtp_server_connection *conn = cmd->conn; - if (conn->helo.domain == NULL || - strcmp(conn->helo.domain, data->helo.domain) != 0 || + if (null_strcmp(conn->helo.domain, data->helo.domain) != 0 || conn->helo.old_smtp != data->helo.old_smtp) data->changed = TRUE; /* Definitive assessment */ } @@ -80,8 +79,7 @@ smtp_server_cmd_helo_run(struct smtp_server_cmd_ctx *cmd, const char *params, helo_data->first = first; command->data = helo_data; - if (conn->helo.domain == NULL || - (domain != NULL && strcmp(conn->helo.domain, domain) != 0) || + if (null_strcmp(conn->helo.domain, domain) != 0 || conn->helo.old_smtp != old_smtp) helo_data->changed = TRUE; /* Preliminary assessment */