BUG/MINOR: h3: properly handle incomplete remote uni stream type
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 9 Mar 2023 10:12:32 +0000 (11:12 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Mar 2023 13:38:06 +0000 (14:38 +0100)
commit5aa21c1748e8b15bb98754c02920e9c22782ca97
treeeab58643b305304518550dc7357709363b505cb0
parent1751db140ab609e38af8218efbd23427115a42aa
BUG/MINOR: h3: properly handle incomplete remote uni stream type

A H3 unidirectional stream is always opened with its stream type first
encoded as a QUIC variable integer. If the STREAM frame contains some
data but not enough to decode this varint, haproxy would crash due to an
ABORT_NOW() statement.

To fix this, ensure we support an incomplete stream type. In this case,
h3_init_uni_stream() returns 0 and the buffer content is not cleared.
Stream decoding will resume when new data are received for this stream
which should be enough to decode the stream type varint.

This bug has never occured on production because standard H3 stream types
are small enough to be encoded on a single byte.

This should be backported up to 2.6.
src/h3.c