]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
submission-login: Fix NULL dereference occurring at an invalid reply from the backend...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 12 Dec 2017 20:46:53 +0000 (21:46 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 12 Dec 2017 21:13:32 +0000 (22:13 +0100)
Problem found by Coverity.

src/submission-login/submission-proxy.c

index 71bfd4b3e87c2cff9a76f7f575bcb4b4cae95698..95774ff8e1f73a5d8877e0713fe84b6ed6c28ebe 100644 (file)
@@ -233,6 +233,8 @@ int submission_proxy_parse_line(struct client *client, const char *line)
                str_parse_uint(line, &status, &text) < 0 ||
                status < 200 || status >= 560) {
                invalid_line = TRUE;
+       } else {
+               text++;
        }
        if (subm_client->proxy_reply_status != 0 &&
                subm_client->proxy_reply_status != status) {
@@ -249,7 +251,6 @@ int submission_proxy_parse_line(struct client *client, const char *line)
        } else {
                subm_client->proxy_reply_status = status;
        }
-       text++;
 
        if ((subm_client->proxy_capability &
                SMTP_CAPABILITY_ENHANCEDSTATUSCODES) != 0)