From: Matt Caswell Date: Fri, 28 Jun 2019 13:29:34 +0000 (+0100) Subject: Only cache a method if we actually created one X-Git-Tag: openssl-3.0.0-alpha1~1839 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=08607613d573de9e3e021227506759f4f58debc6;p=oweals%2Fopenssl.git 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) --- 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