mirror of
https://github.com/nginx/nginx.git
synced 2026-08-04 14:58:20 +00:00
Mail: fixed type overflow in IMAP literal length parser.
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…
Add table
Add a link
Reference in a new issue