mirror of
https://github.com/nginx/nginx.git
synced 2026-04-15 22:09:26 -04:00
Mail: stricter IMAP literals validation.
As clarified in RFC 3501, Section 7.5, literals are followed either by SP, for additional command arguments, or CRLF.
This commit is contained in:
parent
9e7f0f4c53
commit
aa65a60fc7
1 changed files with 4 additions and 8 deletions
|
|
@ -598,20 +598,16 @@ ngx_mail_imap_parse_command(ngx_mail_session_t *s)
|
|||
|
||||
case sw_end_literal_argument:
|
||||
switch (ch) {
|
||||
case '{':
|
||||
if (s->args.nelts <= 2) {
|
||||
state = sw_literal;
|
||||
break;
|
||||
}
|
||||
goto invalid;
|
||||
case ' ':
|
||||
state = sw_spaces_before_argument;
|
||||
break;
|
||||
case CR:
|
||||
state = sw_almost_done;
|
||||
break;
|
||||
case LF:
|
||||
goto done;
|
||||
default:
|
||||
state = sw_spaces_before_argument;
|
||||
break;
|
||||
goto invalid;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue