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.
pull/1139/merge
Sergey Kandaurov 1 week ago committed by Sergey Kandaurov
parent 9e7f0f4c53
commit aa65a60fc7
  1. 12
      src/mail/ngx_mail_parse.c

@ -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…
Cancel
Save