mirror of
https://github.com/openssl/openssl.git
synced 2025-02-05 14:10:53 +08:00
ssl_lib: added pointer SSL and SSL_CONNECTION check to NULL before dereferencing it in ossl_ctrl_internal()
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22470)
This commit is contained in:
parent
24844be16f
commit
b9788ce6a8
@ -2906,9 +2906,8 @@ long SSL_ctrl(SSL *s, int cmd, long larg, void *parg)
|
||||
long ossl_ctrl_internal(SSL *s, int cmd, long larg, void *parg, int no_quic)
|
||||
{
|
||||
long l;
|
||||
SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
|
||||
|
||||
if (sc == NULL)
|
||||
if (s == NULL)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
@ -2929,6 +2928,11 @@ long ossl_ctrl_internal(SSL *s, int cmd, long larg, void *parg, int no_quic)
|
||||
if (!no_quic && IS_QUIC(s))
|
||||
return s->method->ssl_ctrl(s, cmd, larg, parg);
|
||||
|
||||
SSL_CONNECTION* sc = SSL_CONNECTION_FROM_SSL(s);
|
||||
|
||||
if (sc == NULL)
|
||||
return 0;
|
||||
|
||||
switch (cmd) {
|
||||
case SSL_CTRL_GET_READ_AHEAD:
|
||||
return RECORD_LAYER_get_read_ahead(&sc->rlayer);
|
||||
|
Loading…
Reference in New Issue
Block a user