From 08607613d573de9e3e021227506759f4f58debc6 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 28 Jun 2019 14:29:34 +0100 Subject: [PATCH] Only cache a method if we actually created one We were attempting to cache a method after we failed to create it which leads to an assertion failure. Fixes #9264 Reviewed-by: Richard Levitte Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/9269) --- crypto/evp/evp_fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index b039cc0547..e785474372 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -207,7 +207,7 @@ void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, mcmdata.destruct_method = free_method; if ((method = ossl_method_construct(libctx, operation_id, name, properties, 0 /* !force_cache */, - &mcm, &mcmdata)) == NULL) { + &mcm, &mcmdata)) != NULL) { /* * If construction did create a method for us, we know that * there is a correct nameid and methodid, since those have -- 2.39.2