From 19cc0f0ab4d783d3b5ea8c499a095a4cbaae5f14 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 15 Feb 2002 01:01:36 +0000 Subject: [PATCH] Only initialize cipher ctx if cipher is not NULL. --- crypto/evp/evp_enc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index eb39539ca6..9c65a553d3 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -77,7 +77,8 @@ void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv, int enc) { - EVP_CIPHER_CTX_init(ctx); + if (cipher) + EVP_CIPHER_CTX_init(ctx); return EVP_CipherInit_ex(ctx,cipher,NULL,key,iv,enc); }