summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2018-09-03 07:29:45 +1000
committerPauli <paul.dale@oracle.com>2018-09-03 09:57:28 +1000
commita8d3dbe19b5c7e5b828792bfe7dcf8dc6d225c62 (patch)
tree9fa292f63560e40cbbf23baff7dcf96fd6a989eb
parent59701e6363531cddef5b2114c0127b8453deb1f3 (diff)
Check for a failure return from EVP_MD_CTX_new() in OCSP_basic_sign().
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7087)
-rw-r--r--crypto/ocsp/ocsp_srv.c3
1 files changed, 3 insertions, 0 deletions
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;