mirror of
https://github.com/nginx/nginx.git
synced 2026-06-27 12:21:57 +00:00
HTTP/2: improved error handling while parsing integers.
The case when an integer is out of frame bounds should be checked first as a more accurate error.
This commit is contained in:
parent
c830cf28ae
commit
c0eb2f0759
1 changed files with 4 additions and 4 deletions
|
|
@ -2417,14 +2417,14 @@ ngx_http_v2_parse_int(ngx_http_v2_connection_t *h2c, u_char **pos, u_char *end,
|
|||
}
|
||||
}
|
||||
|
||||
if (end == start + NGX_HTTP_V2_INT_OCTETS) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
if ((size_t) (end - start) >= h2c->state.length) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
if (end == start + NGX_HTTP_V2_INT_OCTETS) {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
return NGX_AGAIN;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue