Skip to content

Commit 8011cd5

Browse files
committed
Check session_cert is not NULL before dereferencing it.
1 parent d315265 commit 8011cd5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: ssl/s3_clnt.c

+7
Original file line numberDiff line numberDiff line change
@@ -2512,6 +2512,13 @@ int ssl3_send_client_key_exchange(SSL *s)
25122512
int ecdh_clnt_cert = 0;
25132513
int field_size = 0;
25142514

2515+
if (s->session->sess_cert == NULL)
2516+
{
2517+
ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_UNEXPECTED_MESSAGE);
2518+
SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,SSL_R_UNEXPECTED_MESSAGE);
2519+
goto err;
2520+
}
2521+
25152522
/* Did we send out the client's
25162523
* ECDH share for use in premaster
25172524
* computation as part of client certificate?

0 commit comments

Comments
 (0)