From: Joshua Rogers Date: Sat, 11 Oct 2025 02:39:44 +0000 (+0800) Subject: quic: use PACKET_buf_init instead of writing to PACKET internals X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f6187866ef1b617e32f27f52ce126ff00e8e144;p=thirdparty%2Fopenssl.git quic: use PACKET_buf_init instead of writing to PACKET internals Signed-off-by: Joshua Rogers Reviewed-by: Saša Nedvědický Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/28850) --- 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;