summaryrefslogtreecommitdiffstats
path: root/ssl/s3_enc.c
diff options
context:
space:
mode:
authorJonas Maebe <jonas.maebe@elis.ugent.be>2013-12-09 16:45:44 +0100
committerKurt Roeckx <kurt@roeckx.be>2014-12-10 18:35:17 +0100
commitbf8e7047aa888bdba4a89fd0d03862ebec2d302c (patch)
treec78d333070dd5d8caa85479e1284c88171519437 /ssl/s3_enc.c
parent9052ffda912a48bfb0f6aa1555a97e313ee54642 (diff)
ssl3_digest_cached_records: check for NULL after allocating s->s3->handshake_dgst
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'ssl/s3_enc.c')
-rw-r--r--ssl/s3_enc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index f7de30ba4d..66f5280179 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -616,6 +616,11 @@ int ssl3_digest_cached_records(SSL *s)
/* Allocate handshake_dgst array */
ssl3_free_digest_list(s);
s->s3->handshake_dgst = OPENSSL_malloc(SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *));
+ if (s->s3->handshake_dgst == NULL)
+ {
+ SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_MALLOC_FAILURE);
+ return 0;
+ }
memset(s->s3->handshake_dgst,0,SSL_MAX_DIGEST *sizeof(EVP_MD_CTX *));
hdatalen = BIO_get_mem_data(s->s3->handshake_buffer,&hdata);
if (hdatalen <= 0)