summaryrefslogtreecommitdiffstats
path: root/ssl/s3_pkt.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2008-08-13 19:44:44 +0000
committerBodo Möller <bodo@openssl.org>2008-08-13 19:44:44 +0000
commitf9f6f0e9f0a9f91a4e4a5c3c165b1f5486e75213 (patch)
tree3eec7164c99fba26fb7bd91504697808c7c6d138 /ssl/s3_pkt.c
parent405f3821444d67201f999c86b6c534a081cf10e7 (diff)
sanity check
PR: 1679
Diffstat (limited to 'ssl/s3_pkt.c')
-rw-r--r--ssl/s3_pkt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c
index 44c7c143fe..72853a2e72 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -1225,6 +1225,13 @@ int ssl3_do_change_cipher_spec(SSL *s)
if (s->s3->tmp.key_block == NULL)
{
+ if (s->session == NULL)
+ {
+ /* might happen if dtls1_read_bytes() calls this */
+ SSLerr(SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC,SSL_R_CCS_RECEIVED_EARLY);
+ return (0);
+ }
+
s->session->cipher=s->s3->tmp.new_cipher;
if (!s->method->ssl3_enc->setup_key_block(s)) return(0);
}