From: Aki Tuomi Date: Mon, 14 Feb 2022 11:50:02 +0000 (+0200) Subject: pop3: Fix empty command handling X-Git-Tag: 2.3.19~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=70a924bd84339ae3b8a3961e79adc95ea167e405;p=thirdparty%2Fdovecot%2Fcore.git pop3: Fix empty command handling If empty command is given, error out instead of trying to create event. This fixes a crash caused by d2ab26be6038bd53b13a3ff18c403d6c192c1d91. --- diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index d44ae7f464..6a1b9be342 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -742,8 +742,10 @@ bool client_handle_input(struct client *client) args = strchr(line, ' '); if (args != NULL) *args++ = '\0'; - - T_BEGIN { + if (*line == '\0') { + client_send_line(client, "-ERR Unknown command."); + ret = -1; + } else T_BEGIN { const char *reason_code = event_reason_code_prefix("pop3", "cmd_", line); struct event_reason *reason =