diff options
author | jsing <> | 2014-05-28 13:07:47 +0000 |
---|---|---|
committer | jsing <> | 2014-05-28 13:07:47 +0000 |
commit | 11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81 (patch) | |
tree | 38eb7a5e252ed5faa8e76893ddc332b7e97408c4 /src/lib/libssl/s3_clnt.c | |
parent | 1904ce01988b6ea0f5775507b4d812459c5b3f50 (diff) | |
download | openbsd-11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81.tar.gz openbsd-11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81.tar.bz2 openbsd-11b7ce9aaed6e67e7fb23fa5c3febf635a5e7c81.zip |
EVP_MD_CTX_create() calls malloc and can return NULL. However, only one of
the calls in libssl actually checks the return value before using it. Add
NULL checks for the remaining three calls.
ok miod@
Diffstat (limited to 'src/lib/libssl/s3_clnt.c')
-rw-r--r-- | src/lib/libssl/s3_clnt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/libssl/s3_clnt.c b/src/lib/libssl/s3_clnt.c index ffbd83b060..602ab03fe1 100644 --- a/src/lib/libssl/s3_clnt.c +++ b/src/lib/libssl/s3_clnt.c | |||
@@ -2458,6 +2458,11 @@ ssl3_send_client_key_exchange(SSL *s) | |||
2458 | * context data | 2458 | * context data |
2459 | */ | 2459 | */ |
2460 | ukm_hash = EVP_MD_CTX_create(); | 2460 | ukm_hash = EVP_MD_CTX_create(); |
2461 | if (ukm_hash == NULL) { | ||
2462 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, | ||
2463 | ERR_R_MALLOC_FAILURE); | ||
2464 | goto err; | ||
2465 | } | ||
2461 | EVP_DigestInit(ukm_hash, | 2466 | EVP_DigestInit(ukm_hash, |
2462 | EVP_get_digestbynid(NID_id_GostR3411_94)); | 2467 | EVP_get_digestbynid(NID_id_GostR3411_94)); |
2463 | EVP_DigestUpdate(ukm_hash, | 2468 | EVP_DigestUpdate(ukm_hash, |