From 2f6187866ef1b617e32f27f52ce126ff00e8e144 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Sat, 11 Oct 2025 10:39:44 +0800 Subject: [PATCH] quic: use PACKET_buf_init instead of writing to PACKET internals MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Joshua Rogers Reviewed-by: Saša Nedvědický Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/28850) --- ssl/quic/quic_wire.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ssl/quic/quic_wire.c b/ssl/quic/quic_wire.c index a7c7667797d..6680d999c5c 100644 --- a/ssl/quic/quic_wire.c +++ b/ssl/quic/quic_wire.c @@ -941,12 +941,14 @@ int ossl_quic_wire_decode_transport_param_int(PACKET *pkt, uint64_t *value) { PACKET sub; + const unsigned char *body; + size_t len = 0; - sub.curr = ossl_quic_wire_decode_transport_param_bytes(pkt, - id, &sub.remaining); - if (sub.curr == NULL) + body = ossl_quic_wire_decode_transport_param_bytes(pkt, id, &len); + if (body == NULL) + return 0; + if (!PACKET_buf_init(&sub, body, len)) return 0; - if (!PACKET_get_quic_vlint(&sub, value)) return 0; -- 2.47.3