diff options
author | Valentin Bartenev <vbart@nginx.com> | 2015-10-20 21:28:38 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2015-10-20 21:28:38 +0300 |
commit | c0eb2f0759726f47bd06f5c8f46739f43ce55cac (patch) | |
tree | e85f190352c1bf440fdc75a28bbc7179c46042d4 /src | |
parent | c830cf28ae6216d3bd7e7e27dd9b281aa3d75c2c (diff) | |
download | nginx-c0eb2f0759726f47bd06f5c8f46739f43ce55cac.tar.gz nginx-c0eb2f0759726f47bd06f5c8f46739f43ce55cac.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/v2/ngx_http_v2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 5852c9943..91f7bc9e1 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -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; } |