From: Sergey Kandaurov Date: Tue, 1 Jun 2021 08:41:38 +0000 (+0300) Subject: HTTP/3: fixed parsing encoder insertions with empty header value. X-Git-Tag: release-1.25.0~4^2~320 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=1f85c660cb3e94b60a0f2ec8495f72a43cddb378;p=nginx.git HTTP/3: fixed parsing encoder insertions with empty header value. When starting processing a new encoder instruction, the header state is not memzero'ed because generally it's burdensome. If the header value is empty, this resulted in inserting a stale value left from the previous instruction. Based on a patch by Zhiyong Sun. --- diff --git a/src/http/v3/ngx_http_v3_parse.c b/src/http/v3/ngx_http_v3_parse.c index fcb39b209..40366e665 100644 --- a/src/http/v3/ngx_http_v3_parse.c +++ b/src/http/v3/ngx_http_v3_parse.c @@ -1366,6 +1366,7 @@ ngx_http_v3_parse_header_inr(ngx_connection_t *c, st->literal.length = st->pint.value; if (st->literal.length == 0) { + st->value.len = 0; goto done; } @@ -1470,6 +1471,7 @@ ngx_http_v3_parse_header_iwnr(ngx_connection_t *c, st->literal.length = st->pint.value; if (st->literal.length == 0) { + st->value.len = 0; goto done; }