Commit 329a985708 for openssl.org
commit 329a985708ba5b04ca2099e049e17429e205d61d
Author: gibKim <gbkim0909@gmail.com>
Date: Tue Oct 27 10:14:33 2026 +0900
Set msgstart in PACKET_get_quic_length_prefixed()
Every other length-prefixed sub-packet reader propagates the parent's
msgstart to the sub-packet, but PACKET_get_quic_length_prefixed() left
it untouched, so PACKET_msg_start() on the sub-packet returned whatever
value it held before.
Extend test_PACKET_get_quic_length_prefixed() to check it.
Resolves: https://github.com/openssl/openssl/issues/33385
Fixes: 416d0a638c16 "QUIC wire format support"
Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Merge-date: Wed Oct 28 11:24:11 2026
Merged-from: https://github.com/openssl/openssl/pull/33408
diff --git a/include/internal/packet_quic.h b/include/internal/packet_quic.h
index 783ede3771..4f6bbab709 100644
--- a/include/internal/packet_quic.h
+++ b/include/internal/packet_quic.h
@@ -110,6 +110,7 @@ __owur static ossl_inline int PACKET_get_quic_length_prefixed(PACKET *pkt,
*pkt = tmp;
subpkt->curr = data;
+ subpkt->msgstart = pkt->msgstart;
subpkt->remaining = (size_t)length;
return 1;
diff --git a/test/packettest.c b/test/packettest.c
index 5aa9890ab3..2a3d776aaf 100644
--- a/test/packettest.c
+++ b/test/packettest.c
@@ -565,6 +565,9 @@ static int test_PACKET_get_quic_length_prefixed(void)
if (!TEST_size_t_eq(subpkt.remaining, cases[i].len))
return 0;
+
+ if (!TEST_ptr_eq(PACKET_msg_start(&subpkt), cases[i].buf))
+ return 0;
}
return 1;