]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Fixed assertion in smtp_server_connection_next_reply() checking...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 18 Dec 2017 15:45:23 +0000 (16:45 +0100)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 22 Dec 2017 10:46:52 +0000 (12:46 +0200)
It did not handle LMTP DATA/BDAT command correctly, for which there can be multiple replies.

This fixes mixing local/remote recipients in LMTP, which used to crash:
Panic: file smtp-server-connection.c: line 610 (smtp_server_connection_next_reply): assertion failed: (cmd->state == SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY && smtp_server_command_is_replied(cmd))

src/lib-smtp/smtp-server-connection.c

index 6f871714d3ca31c887304726fb2699ed54d51724..5c9583a1f6d5b801c50920f16f5ecf733d38e8b6 100644 (file)
@@ -609,7 +609,7 @@ smtp_server_connection_next_reply(struct smtp_server_connection *conn)
        }
 
        i_assert(cmd->state == SMTP_SERVER_COMMAND_STATE_READY_TO_REPLY &&
-                smtp_server_command_is_replied(cmd));
+                array_is_created(&cmd->replies));
 
        smtp_server_command_completed(cmd);
 
@@ -619,8 +619,6 @@ smtp_server_connection_next_reply(struct smtp_server_connection *conn)
        for (i = 0; i < cmd->replies_expected; i++) {
                struct smtp_server_reply *reply;
 
-               if (!array_is_created(&cmd->replies))
-                       break;
                reply = array_idx_modifiable(&cmd->replies, i);
 
                if (!reply->submitted) {