[nginx] Mail: fixed possible uninitialized memory access.

Maxim Dounin mdounin at mdounin.ru
Wed Jun 5 16:10:04 UTC 2013


details:   http://hg.nginx.org/nginx/rev/b6562f98bfd8
branches:  
changeset: 5246:b6562f98bfd8
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Wed Jun 05 19:44:23 2013 +0400
description:
Mail: fixed possible uninitialized memory access.

Found by Valgrind.

diffstat:

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

diffs (14 lines):

diff --git a/src/mail/ngx_mail_parse.c b/src/mail/ngx_mail_parse.c
--- a/src/mail/ngx_mail_parse.c
+++ b/src/mail/ngx_mail_parse.c
@@ -842,6 +842,10 @@ ngx_mail_auth_parse(ngx_mail_session_t *
     }
 #endif
 
+    if (s->args.nelts == 0) {
+        return NGX_MAIL_PARSE_INVALID_COMMAND;
+    }
+
     arg = s->args.elts;
 
     if (arg[0].len == 5) {



More information about the nginx-devel mailing list