aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/t1_lib.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-05-03 18:02:01 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-05-03 18:02:01 +0000
commit47b11f985b9e0ff561a67e19674de6fbcf79281d (patch)
treeda6c0490c1781cf42777777890fc53da00f780ed /ssl/t1_lib.c
parent8f9fae4c4537bd423d1a266b3280c396a2e90f44 (diff)
downloadsrc-47b11f985b9e0ff561a67e19674de6fbcf79281d.tar.gz
src-47b11f985b9e0ff561a67e19674de6fbcf79281d.zip
Import OpenSSL 1.0.1t.vendor/openssl/1.0.1t
Notes
Notes: svn path=/vendor-crypto/openssl/dist-1.0.1/; revision=298993 svn path=/vendor-crypto/openssl/1.0.1t/; revision=298994; tag=vendor/openssl/1.0.1t
Diffstat (limited to 'ssl/t1_lib.c')
-rw-r--r--ssl/t1_lib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 2e9b65b3fdce..0bdb77d49fc3 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -2321,8 +2321,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick,
p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx);
eticklen -= 16 + EVP_CIPHER_CTX_iv_length(&ctx);
sdec = OPENSSL_malloc(eticklen);
- if (!sdec || EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen) <= 0) {
+ if (sdec == NULL
+ || EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen) <= 0) {
EVP_CIPHER_CTX_cleanup(&ctx);
+ OPENSSL_free(sdec);
return -1;
}
if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) {
@@ -2579,6 +2581,8 @@ int tls1_process_heartbeat(SSL *s)
* plus 2 bytes payload length, plus payload, plus padding
*/
buffer = OPENSSL_malloc(1 + 2 + payload + padding);
+ if (buffer == NULL)
+ return -1;
bp = buffer;
/* Enter response type, length and copy payload */