mirror of
https://github.com/nginx/nginx.git
synced 2026-10-24 14:47:45 -05:00
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:
1 parent
cae9999860
commit
35a437d3d9
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user