mirror of
https://github.com/nginx/nginx.git
synced 2026-09-01 02:58:40 +00:00
HTTP/3: null-terminate empty header value.
Header value returned from the HTTP parser is expected to be null-terminated or have a spare byte after the value bytes. When an empty header value was passed by client in a literal header representation, neither was true. This could result in segfault. The fix is to assign a literal empty null-terminated string in this case. Thanks to Andrey Kolyshkin.
This commit is contained in:
parent
49f0b0d99d
commit
9129fb3db9
1 changed files with 1 additions and 0 deletions
|
|
@ -746,6 +746,7 @@ ngx_http_v3_parse_header_l(ngx_connection_t *c,
|
|||
|
||||
st->literal.length = st->pint.value;
|
||||
if (st->literal.length == 0) {
|
||||
st->value.data = (u_char *) "";
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue