summaryrefslogtreecommitdiffstats
path: root/ssl/s3_pkt.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2008-08-13 19:45:06 +0000
committerBodo Möller <bodo@openssl.org>2008-08-13 19:45:06 +0000
commit1cbf663a6c89dcf8f7706d30a8bae675e2e0199a (patch)
tree3eb3113393ea476cd756a99178c681fd8db54883 /ssl/s3_pkt.c
parent9be8035b11ba781e513f31241a34ac2bfd406d93 (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 07dd4b23d5..7593ad9195 100644
--- a/ssl/s3_pkt.c
+++ b/ssl/s3_pkt.c
@@ -1302,6 +1302,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);
}