HTTP/3: require that field section base index is not negative.

RFC 9204 explicitly requires that.
This commit is contained in:
Roman Arutyunyan 2022-05-26 16:17:56 +04:00
parent 86a3380000
commit b752b1ec26
1 changed files with 6 additions and 0 deletions

View File

@ -474,7 +474,13 @@ done:
}
if (st->sign) {
if (st->insert_count <= st->delta_base) {
ngx_log_error(NGX_LOG_INFO, c->log, 0, "client sent negative base");
return NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED;
}
st->base = st->insert_count - st->delta_base - 1;
} else {
st->base = st->insert_count + st->delta_base;
}