]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
quic_channel.c: NULL check SSL_CONNECTION master
authorNorbert Pocs <norbertp@openssl.org>
Fri, 8 Aug 2025 13:17:06 +0000 (15:17 +0200)
committerNeil Horman <nhorman@openssl.org>
Sun, 10 Aug 2025 21:16:02 +0000 (17:16 -0400)
Addresses coverity issue #1662037

Fixes: https://github.com/openssl/project/issues/1316
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28208)

ssl/quic/quic_channel.c

index 652c653b912046d80c00f9b0270aa08a9ab0a4c7..12bda515e607c4510e2b38dff86d653d6bb614d8 100644 (file)
@@ -1333,6 +1333,11 @@ static int ch_on_transport_params(const unsigned char *params,
     QUIC_PREFERRED_ADDR pfa;
     SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ch->tls);
 
+    if (sc == NULL) {
+        ossl_quic_channel_raise_protocol_error(ch, OSSL_QUIC_ERR_INTERNAL_ERROR, 0,
+                                               "could not get ssl connection");
+        return 0;
+    }
     /*
      * When HRR happens the client sends the transport params in the new client
      * hello again. Reset the transport params here and load them again.