# HG changeset patch # User Roman Arutyunyan # Date 1589892101 -10800 # Node ID c101438c69a400ce866285848bcf8f1b18cee897 # Parent af22b60a905bc886c1320ed13fc97a18bee45c78 HTTP/3: prevent array access by negative index for unknown streams. Currently there are no such streams, but the function ngx_http_v3_get_uni_stream() supports them. diff --git a/src/http/v3/ngx_http_v3_streams.c b/src/http/v3/ngx_http_v3_streams.c --- a/src/http/v3/ngx_http_v3_streams.c +++ b/src/http/v3/ngx_http_v3_streams.c @@ -320,7 +320,9 @@ ngx_http_v3_get_uni_stream(ngx_connectio sc->read->handler = ngx_http_v3_uni_read_handler; sc->write->handler = ngx_http_v3_dummy_write_handler; - h3c->known_streams[index] = sc; + if (index >= 0) { + h3c->known_streams[index] = sc; + } n = (u_char *) ngx_http_v3_encode_varlen_int(buf, type) - buf;