]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Fix empty command handling
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 14 Feb 2022 11:50:02 +0000 (13:50 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 15 Feb 2022 10:15:12 +0000 (12:15 +0200)
If empty command is given, error out instead of trying to create event.
This fixes a crash caused by d2ab26be6038bd53b13a3ff18c403d6c192c1d91.

src/pop3/pop3-client.c

index d44ae7f464e35485a91440d68a1f17087604ad3c..6a1b9be342731c45491a5fd0a435c61d5d742336 100644 (file)
@@ -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 =