quic_channel.c: NULL check SSL_CONNECTION

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)
This commit is contained in:
Norbert Pocs 2025-08-08 15:17:06 +02:00 committed by Neil Horman
parent 760929f6ba
commit c5ef06f4ab
1 changed files with 5 additions and 0 deletions

View File

@ -1333,6 +1333,11 @@ static int ch_on_transport_params(const unsigned char *params,
QUIC_PREFERRED_ADDR pfa; QUIC_PREFERRED_ADDR pfa;
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(ch->tls); 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 * When HRR happens the client sends the transport params in the new client
* hello again. Reset the transport params here and load them again. * hello again. Reset the transport params here and load them again.