diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-06-18 04:50:45 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-06-18 04:50:45 +0000 |
commit | c87b3072058cda1442510d46153f9b79d562e06a (patch) | |
tree | 5057c26ed4c720ef76a1eb432ffe47ec6672224e /lib | |
parent | d80d7415a399fc9fb3d89b120bb812f617c48238 (diff) |
Missinc calloc() return value check; ok deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/ssl/s3_enc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libssl/src/ssl/s3_enc.c b/lib/libssl/src/ssl/s3_enc.c index 6170b553f0c..dfb4c283f1e 100644 --- a/lib/libssl/src/ssl/s3_enc.c +++ b/lib/libssl/src/ssl/s3_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_enc.c,v 1.49 2014/06/15 15:29:25 jsing Exp $ */ +/* $OpenBSD: s3_enc.c,v 1.50 2014/06/18 04:50:44 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -608,6 +608,10 @@ ssl3_digest_cached_records(SSL *s) ssl3_free_digest_list(s); s->s3->handshake_dgst = calloc(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; + } hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0) { SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, |