]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/evp/legacy_sha.c
EVP shake_ctrl(): add missing NULL evp_ctx check
[thirdparty/openssl.git] / crypto / evp / legacy_sha.c
index 3859286eeb2046e6532919a19fdba3e5174715d5..0c2afc29007597e947785c60e50ac2984948a46c 100644 (file)
@@ -71,7 +71,11 @@ static int sha1_int_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2)
 
 static int shake_ctrl(EVP_MD_CTX *evp_ctx, int cmd, int p1, void *p2)
 {
-    KECCAK1600_CTX *ctx = evp_ctx->md_data;
+    KECCAK1600_CTX *ctx;
+
+    if (evp_ctx == NULL)
+        return 0;
+    ctx = evp_ctx->md_data;
 
     switch (cmd) {
     case EVP_MD_CTRL_XOF_LEN: