summaryrefslogtreecommitdiffstats
path: root/contrib/libs/nghttp3/lib/nghttp3_http.c
diff options
context:
space:
mode:
authorrobot-contrib <[email protected]>2025-05-01 08:17:53 +0300
committerrobot-contrib <[email protected]>2025-05-01 08:57:12 +0300
commit0d5861bb6d9b5e7f39cbdc17456909efab426bd9 (patch)
tree9414709cf2454ae612ed7a34c34a8047436d6932 /contrib/libs/nghttp3/lib/nghttp3_http.c
parenta24e6ced72db4dbcfba43e2f8c630986b2c9c38b (diff)
Update contrib/libs/nghttp3 to 1.9.0
commit_hash:404c76a4ce7d29b42f27d1a0cd72424faad00313
Diffstat (limited to 'contrib/libs/nghttp3/lib/nghttp3_http.c')
-rw-r--r--contrib/libs/nghttp3/lib/nghttp3_http.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/libs/nghttp3/lib/nghttp3_http.c b/contrib/libs/nghttp3/lib/nghttp3_http.c
index be3dadfb453..9a8f06ea11d 100644
--- a/contrib/libs/nghttp3/lib/nghttp3_http.c
+++ b/contrib/libs/nghttp3/lib/nghttp3_http.c
@@ -69,11 +69,11 @@ static int64_t parse_uint(const uint8_t *s, size_t len) {
}
for (i = 0; i < len; ++i) {
if ('0' <= s[i] && s[i] <= '9') {
- if (n > INT64_MAX / 10) {
+ if (n > (int64_t)NGHTTP3_MAX_VARINT / 10) {
return -1;
}
n *= 10;
- if (n > INT64_MAX - (s[i] - '0')) {
+ if (n > (int64_t)NGHTTP3_MAX_VARINT - (s[i] - '0')) {
return -1;
}
n += s[i] - '0';
@@ -549,6 +549,9 @@ static int http_request_on_header(nghttp3_http_state *http,
break;
case NGHTTP3_QPACK_TOKEN_PRIORITY:
if (!nghttp3_check_header_value(nv->value->base, nv->value->len)) {
+ http->flags &= ~NGHTTP3_HTTP_FLAG_PRIORITY;
+ http->flags |= NGHTTP3_HTTP_FLAG_BAD_PRIORITY;
+
return NGHTTP3_ERR_REMOVE_HTTP_HEADER;
}
@@ -992,7 +995,11 @@ int nghttp3_check_header_value(const uint8_t *value, size_t len) {
case 0:
return 1;
case 1:
- return !is_ws(*value);
+ if (is_ws(*value)) {
+ return 0;
+ }
+
+ break;
default:
if (is_ws(*value) || is_ws(*(value + len - 1))) {
return 0;