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)
This commit is contained in:
Pauli 2018-09-03 07:29:45 +10:00
parent 59701e6363
commit a8d3dbe19b

View file

@ -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;