From: Pauli Date: Sun, 2 Sep 2018 21:29:45 +0000 (+1000) Subject: Check for a failure return from EVP_MD_CTX_new() in OCSP_basic_sign(). X-Git-Tag: OpenSSL_1_1_1~70 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a8d3dbe19b5c7e5b828792bfe7dcf8dc6d225c62;p=oweals%2Fopenssl.git Check for a failure return from EVP_MD_CTX_new() in OCSP_basic_sign(). Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/7087) --- diff --git a/crypto/ocsp/ocsp_srv.c b/crypto/ocsp/ocsp_srv.c index eff6ddbd60..6bd6f7b6d8 100644 --- a/crypto/ocsp/ocsp_srv.c +++ b/crypto/ocsp/ocsp_srv.c @@ -237,6 +237,9 @@ int OCSP_basic_sign(OCSP_BASICRESP *brsp, EVP_PKEY_CTX *pkctx = NULL; int i; + if (ctx == NULL) + return 0; + if (!EVP_DigestSignInit(ctx, &pkctx, dgst, NULL, key)) { EVP_MD_CTX_free(ctx); return 0;