summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2014-05-29 08:47:56 +0000
committerjsing <>2014-05-29 08:47:56 +0000
commit245ae4880e530f12d2b009a9053afc4ff8da74f9 (patch)
tree507e8da7c2302e46daaee4ebd710e5293d58baf9
parent229e1a621cf7a14c29000b7036cefb186f148528 (diff)
downloadopenbsd-245ae4880e530f12d2b009a9053afc4ff8da74f9.tar.gz
openbsd-245ae4880e530f12d2b009a9053afc4ff8da74f9.tar.bz2
openbsd-245ae4880e530f12d2b009a9053afc4ff8da74f9.zip
Add missing NULL checks for calls to ssl_replace_hash(). This function
calls EVP_MD_CTX_create(), which will return NULL if it fails to allocate memory. ok miod@
-rw-r--r--src/lib/libssl/src/ssl/s3_enc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libssl/src/ssl/s3_enc.c b/src/lib/libssl/src/ssl/s3_enc.c
index aa729860fe..f3c641849a 100644
--- a/src/lib/libssl/src/ssl/s3_enc.c
+++ b/src/lib/libssl/src/ssl/s3_enc.c
@@ -251,7 +251,9 @@ ssl3_change_cipher_state(SSL *s, int which)
251 } 251 }
252 dd = s->enc_read_ctx; 252 dd = s->enc_read_ctx;
253 253
254 ssl_replace_hash(&s->read_hash, m); 254 if (ssl_replace_hash(&s->read_hash, m) == NULL)
255 goto err;
256
255#ifndef OPENSSL_NO_COMP 257#ifndef OPENSSL_NO_COMP
256 /* COMPRESS */ 258 /* COMPRESS */
257 if (s->expand != NULL) { 259 if (s->expand != NULL) {
@@ -282,7 +284,9 @@ ssl3_change_cipher_state(SSL *s, int which)
282 EVP_CIPHER_CTX_init(s->enc_write_ctx); 284 EVP_CIPHER_CTX_init(s->enc_write_ctx);
283 } 285 }
284 dd = s->enc_write_ctx; 286 dd = s->enc_write_ctx;
285 ssl_replace_hash(&s->write_hash, m); 287 if (ssl_replace_hash(&s->write_hash, m) == NULL)
288 goto err;
289
286#ifndef OPENSSL_NO_COMP 290#ifndef OPENSSL_NO_COMP
287 /* COMPRESS */ 291 /* COMPRESS */
288 if (s->compress != NULL) { 292 if (s->compress != NULL) {