diff src/mail/ngx_mail_auth_http_module.c @ 5987:62c098eb4509

Mail: fixed buffer allocation for CRLF after Auth-SMTP-* headers. There were no buffer overruns in real life as there is extra space allocated for the Auth-Login-Attempt counter.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 25 Feb 2015 17:47:43 +0300
parents 0cbefdcf82a6
children 3b3f789655dc
line wrap: on
line diff
--- a/src/mail/ngx_mail_auth_http_module.c
+++ b/src/mail/ngx_mail_auth_http_module.c
@@ -1170,9 +1170,9 @@ ngx_mail_auth_http_create_request(ngx_ma
           + sizeof("Client-IP: ") - 1 + s->connection->addr_text.len
                 + sizeof(CRLF) - 1
           + sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1
-          + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len
-          + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len
-          + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len
+          + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len + sizeof(CRLF) - 1
+          + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len + sizeof(CRLF) - 1
+          + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len + sizeof(CRLF) - 1
           + ahcf->header.len
           + sizeof(CRLF) - 1;