comparison src/http/v2/ngx_http_v2.c @ 6268:ee16fb0db905

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.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 20 Oct 2015 21:28:38 +0300
parents adaac65899c8
children 22ee99422329
comparison
equal deleted inserted replaced
6267:adaac65899c8 6268:ee16fb0db905
2415 *pos = p; 2415 *pos = p;
2416 return value; 2416 return value;
2417 } 2417 }
2418 } 2418 }
2419 2419
2420 if ((size_t) (end - start) >= h2c->state.length) {
2421 return NGX_ERROR;
2422 }
2423
2420 if (end == start + NGX_HTTP_V2_INT_OCTETS) { 2424 if (end == start + NGX_HTTP_V2_INT_OCTETS) {
2421 return NGX_DECLINED; 2425 return NGX_DECLINED;
2422 }
2423
2424 if ((size_t) (end - start) >= h2c->state.length) {
2425 return NGX_ERROR;
2426 } 2426 }
2427 2427
2428 return NGX_AGAIN; 2428 return NGX_AGAIN;
2429 } 2429 }
2430 2430