From: Jonas Maebe Date: Sun, 8 Dec 2013 17:09:20 +0000 (+0100) Subject: dev_crypto_init_key: return error if allocating CDATA(ctx)->key failed X-Git-Tag: master-post-reformat~498 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c84029dbdc57edfb9c6cd94f3a730749adb0236a;p=oweals%2Fopenssl.git dev_crypto_init_key: return error if allocating CDATA(ctx)->key failed Signed-off-by: Kurt Roeckx Reviewed-by: Rich Salz --- diff --git a/crypto/evp/openbsd_hw.c b/crypto/evp/openbsd_hw.c index 3831a5731e..93ed5d6515 100644 --- a/crypto/evp/openbsd_hw.c +++ b/crypto/evp/openbsd_hw.c @@ -134,6 +134,8 @@ static int dev_crypto_init_key(EVP_CIPHER_CTX *ctx,int cipher, return 0; CDATA(ctx)->key=OPENSSL_malloc(MAX_HW_KEY); + if (CDATA(ctx)->key == NULL) + return 0; assert(ctx->cipher->iv_len <= MAX_HW_IV);