From 7b955ca63b2a27b0c2044684a8aae61425d23861 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 24 Nov 2026 15:43:22 +0100 Subject: [PATCH] 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. --- src/h3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3