The branch master has been updated
       via  7928ee4d685b727619555bc1ec0aee805f6fc8c4 (commit)
      from  f1429b85c5821e55224e5878da9d0fa420a41f71 (commit)


- Log -----------------------------------------------------------------
commit 7928ee4d685b727619555bc1ec0aee805f6fc8c4
Author: Bernd Edlinger <[email protected]>
Date:   Thu Dec 22 13:51:27 2016 +0100

    Fix error handling in compute_key, BN_CTX_get can return NULL
    
    Reviewed-by: Rich Salz <[email protected]>
    Reviewed-by: Richard Levitte <[email protected]>
    (Merged from https://github.com/openssl/openssl/pull/2132)

-----------------------------------------------------------------------

Summary of changes:
 crypto/dh/dh_key.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index fe02190..204e5a7 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -159,6 +159,8 @@ static int compute_key(unsigned char *key, const BIGNUM 
*pub_key, DH *dh)
         goto err;
     BN_CTX_start(ctx);
     tmp = BN_CTX_get(ctx);
+    if (tmp == NULL)
+        goto err;
 
     if (dh->priv_key == NULL) {
         DHerr(DH_F_COMPUTE_KEY, DH_R_NO_PRIVATE_VALUE);
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to