From: Bernd Edlinger Date: Sun, 23 Mar 2025 14:20:34 +0000 (+0100) Subject: Try to fix endless loops in quic_multistream_test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad684e1a6a925c7fbadad7d309f0204f49e67105;p=thirdparty%2Fopenssl.git Try to fix endless loops in quic_multistream_test The problem seem to be caused by syntax errors due to injected OSSL_QUIC_FRAME_TYPE_PATH_CHALLENGE packets which are too short by 8 bytes. Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27089) --- diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index b73c8bef7ed..b9a09460903 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -2827,7 +2827,7 @@ static int script_21_inject_plain(struct helper *h, QUIC_PKT_HDR *hdr, { int ok = 0; WPACKET wpkt; - unsigned char frame_buf[8]; + unsigned char frame_buf[9]; size_t written; if (h->inject_word0 == 0 || hdr->type != h->inject_word0) @@ -2840,6 +2840,19 @@ static int script_21_inject_plain(struct helper *h, QUIC_PKT_HDR *hdr, if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, h->inject_word1))) goto err; + switch (h->inject_word1) { + case OSSL_QUIC_FRAME_TYPE_PATH_CHALLENGE: + if (!TEST_true(WPACKET_put_bytes_u64(&wpkt, (uint64_t)0))) + goto err; + break; + case OSSL_QUIC_FRAME_TYPE_STREAM_DATA_BLOCKED: + if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, (uint64_t)0))) + goto err; + if (!TEST_true(WPACKET_quic_write_vlint(&wpkt, (uint64_t)0))) + goto err; + break; + } + if (!TEST_true(WPACKET_get_total_written(&wpkt, &written))) goto err;