mirror of
https://github.com/nginx/nginx.git
synced 2026-06-13 19:00:34 -04:00
Mail: fixed type overflow in IMAP literal length parser.
Some checks failed
buildbot / buildbot (push) Has been cancelled
Some checks failed
buildbot / buildbot (push) Has been cancelled
The overflow is safe, because the maximum length of literals is limited with the "imap_client_buffer" directive. Reported by Bartłomiej Dmitruk.
This commit is contained in:
parent
aa65a60fc7
commit
dff46cd1ae
1 changed files with 3 additions and 0 deletions
|
|
@ -539,6 +539,9 @@ ngx_mail_imap_parse_command(ngx_mail_session_t *s)
|
|||
break;
|
||||
|
||||
case sw_literal:
|
||||
if (s->literal_len > NGX_MAX_SIZE_T_VALUE / 10) {
|
||||
goto invalid;
|
||||
}
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
s->literal_len = s->literal_len * 10 + (ch - '0');
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue