comparison src/mail/ngx_mail_pop3_handler.c @ 571:5938746e70c2 PATCH_NGINX_MAIL_0_8

Mail: get rid of ugly protocol check in ngx_mail_auth_parse(). Instead, use index of argument which holds authentication mechanism name. For IMAP and POP3 it's 0, for SMTP - 1 as SMTP preserves command in first argument to allow pipelining support. While here, add check that we actually have argument holding authentication mechanism name. Currently IMAP has no appropriate checks before calling ngx_mail_auth_parse() which results in possible access of uninitialized memory.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 27 Sep 2009 00:52:15 +0400
parents 2580fe1c5a9a
children 0b460e61bdcd
comparison
equal deleted inserted replaced
570:9773720b845e 571:5938746e70c2
460 s->state = 0; 460 s->state = 0;
461 461
462 return NGX_OK; 462 return NGX_OK;
463 } 463 }
464 464
465 rc = ngx_mail_auth_parse(s, c); 465 rc = ngx_mail_auth_parse(s, c, 0);
466 466
467 switch (rc) { 467 switch (rc) {
468 468
469 case NGX_MAIL_AUTH_LOGIN: 469 case NGX_MAIL_AUTH_LOGIN:
470 470