]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/quic nit: restrict length of cid
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 24 Jul 2026 08:48:20 +0000 (10:48 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 24 Jul 2026 09:20:35 +0000 (11:20 +0200)
The ngtcp2_cid_init() docs say that we must not pass more.
Fortunately, these cases were unreachable from current code.

scan.coverity.com noticed this with ID 651670

daemon/quic_common.c

index 549ce80a5d1a6741bfa1af2fd15dd924e5805714..8588506b178ddd0ee6d3bf7500482e1ab4470bac 100644 (file)
@@ -159,7 +159,7 @@ int init_random_cid(ngtcp2_cid *cid, size_t len)
        if (len == 0)
                len = SERVER_DEFAULT_SCIDLEN;
 
-       uint8_t buf[32];
+       uint8_t buf[NGTCP2_MAX_CIDLEN];
        if (len > sizeof(buf)) {
                len = sizeof(buf);
        }