]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
quic: use PACKET_buf_init instead of writing to PACKET internals
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Sat, 11 Oct 2025 02:39:44 +0000 (10:39 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Oct 2025 17:24:13 +0000 (19:24 +0200)
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28850)

ssl/quic/quic_wire.c

index a7c7667797d9d07cc123be8e9a5a338519d5dcca..6680d999c5cbce7147be85d1db2c08c0c334a51f 100644 (file)
@@ -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;