summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2014-05-29 08:47:56 +0000
committerjsing <>2014-05-29 08:47:56 +0000
commit2ad70e8a88961d1009c50ccc6d5ee104299eebde (patch)
tree507e8da7c2302e46daaee4ebd710e5293d58baf9 /src
parent77a0cef16541065749137ee6c39a139897456bba (diff)
downloadopenbsd-2ad70e8a88961d1009c50ccc6d5ee104299eebde.tar.gz
openbsd-2ad70e8a88961d1009c50ccc6d5ee104299eebde.tar.bz2
openbsd-2ad70e8a88961d1009c50ccc6d5ee104299eebde.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@
Diffstat (limited to 'src')
-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) {