HTTP/3: avoid undefined behaviour with empty encoder field values

A zero length field value in encoder stream instructions left the value
data pointer NULL, passed then to ngx_memcpy() in ngx_http_v3_insert().
For the reasons outlined in b0a4d0fb8, it is now set to an empty string.
This commit is contained in:
dgprivate authored and Sergey Kandaurov committed 2026-10-15 19:00:47 +04:00
1 parent cae9999860
commit 35a437d3d9
1 file changed
+2 -2
+2 -2
View File
@@ -1543,7 +1543,7 @@ ngx_http_v3_parse_field_inr(ngx_connection_t *c,
st->literal.length = st->pint.value;
if (st->literal.length == 0) {
st->value.len = 0;
ngx_str_set(&st->value, "");
goto done;
}
@@ -1667,7 +1667,7 @@ ngx_http_v3_parse_field_iln(ngx_connection_t *c,
st->literal.length = st->pint.value;
if (st->literal.length == 0) {
st->value.len = 0;
ngx_str_set(&st->value, "");
goto done;
}