Welcome! Log In Create A New Profile

Advanced

[nginx] Mail: added a check for the number of arguments in MAIL/...

Maxim Dounin
May 21, 2014 01:58PM
details: http://hg.nginx.org/nginx/rev/7deb01451486
branches:
changeset: 5703:7deb01451486
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed May 21 21:56:20 2014 +0400
description:
Mail: added a check for the number of arguments in MAIL/RCPT.

Missed during introduction of the SMTP pipelining support (04e43d03e153,
1.5.6). Previously, the check wasn't needed as s->buffer was used directly
and the number of arguments didn't matter.

Reported by Svyatoslav Nikolsky.

diffstat:

src/mail/ngx_mail_smtp_handler.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diffs (27 lines):

diff --git a/src/mail/ngx_mail_smtp_handler.c b/src/mail/ngx_mail_smtp_handler.c
--- a/src/mail/ngx_mail_smtp_handler.c
+++ b/src/mail/ngx_mail_smtp_handler.c
@@ -679,6 +679,11 @@ ngx_mail_smtp_mail(ngx_mail_session_t *s
return NGX_OK;
}

+ if (s->args.nelts == 0) {
+ ngx_str_set(&s->out, smtp_invalid_argument);
+ return NGX_OK;
+ }
+
arg = s->args.elts;
arg += s->args.nelts - 1;

@@ -713,6 +718,11 @@ ngx_mail_smtp_rcpt(ngx_mail_session_t *s
return NGX_OK;
}

+ if (s->args.nelts == 0) {
+ ngx_str_set(&s->out, smtp_invalid_argument);
+ return NGX_OK;
+ }
+
arg = s->args.elts;
arg += s->args.nelts - 1;


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Mail: added a check for the number of arguments in MAIL/...

Maxim Dounin 608 May 21, 2014 01:58PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 143
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready