Commit 57ef98cf8d for openssl.org
commit 57ef98cf8da038e22170729f2fb33f698f758295
Author: Neil Horman <nhorman@openssl.org>
Date: Tue Sep 29 14:20:39 2026 -0400
use proper loop index when building new cid in packet
commit 596baa5b032dc4bc3f89f97f4b57ae63c56d5f93 added a test that builds
a series of packets with connection ids in them, using the index i for
the outer packet loop, and index j for the inner WPACKET_memcpy_u8 loop
to copy the cid into the packet. However the i index was used to index
the cid id array, and so after 8 packets (the length of a connection
id), we started indexing off the end of the array, which triggered an
msan issue in CI.
Use the proper loop index j for the copy loop of the cid.
Fixes openssl/project#2066
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Bob Beck <beck@openssl.org>
Merge-date: Tue Sep 29 20:39:25 2026
Merged-from: https://github.com/openssl/openssl/pull/33040
diff --git a/test/radix/quic_tests.c b/test/radix/quic_tests.c
index 05c09876ac..529a254394 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -3915,7 +3915,7 @@ static int inject_new_cids(RADIX_FAULT *fault, QUIC_PKT_HDR *hdr,
retire_prior_to++;
for (j = 0; j < new_cid.id_len && i < OSSL_NELEM(new_cid.id); ++j)
- if (!TEST_true(WPACKET_put_bytes_u8(&wpkt, new_cid.id[i])))
+ if (!TEST_true(WPACKET_put_bytes_u8(&wpkt, new_cid.id[j])))
goto err;
for (; j < new_cid.id_len; ++j)