Commit c84029db authored by Jonas Maebe's avatar Jonas Maebe Committed by Kurt Roeckx
Browse files

dev_crypto_init_key: return error if allocating CDATA(ctx)->key failed



Signed-off-by: default avatarKurt Roeckx <kurt@openssl.org>
Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent 75048789
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);