From: Amaury Denoyelle Date: Tue, 24 Nov 2026 14:43:22 +0000 (+0100) Subject: BUG/MINOR: h3: extend coverage for duplicate SETTINGS ids X-Git-Url: https://git.kaiwu.me/http/%7B@url%7D?a=commitdiff_plain;h=7b955ca63b2a27b0c2044684a8aae61425d23861;p=haproxy.git BUG/MINOR: h3: extend coverage for duplicate SETTINGS ids RFC 9114 forbids the emission of duplicate settings IDs in the same frame. The receiver may report an error when this occurs. Settings IDs are expressed as QUIC varint and their range is thus quite large. As a convenience, only the smallest IDs set is checked, which matches the most frequent usage. A mistake in the previous code restricts unnecessarily the check to IDs less than sizeof long, so typically only IDs from 0 to 7 are really checked on a 64-bit platform. Fix this by multiplying sizeof() by 8, covering all IDs up to 63 (31 on a 32-bit platform). This should be backported up to 2.6 after a period of observation. --- diff --git a/src/h3.c b/src/h3.c index 50eeb64fc..6eb68400d 100644 --- a/src/h3.c +++ b/src/h3.c @@ -1892,7 +1892,7 @@ static ssize_t h3_parse_settings_frm(struct h3c *h3c, const struct buffer *buf, */ /* Ignore duplicate check for ID too big used for GREASE. */ - if (id < sizeof(mask)) { + if (id < (8 * sizeof(mask))) { if (ha_bit_test(id, &mask)) { h3c->err = H3_ERR_SETTINGS_ERROR; return -1;