diff options
author | x2018 <xkernel.wang@foxmail.com> | 2021-12-01 14:29:58 +0800 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-12-10 15:20:29 +1100 |
commit | 318e97997a514b16ca497cedb49730bc75764a05 (patch) | |
tree | 2726e4673521ba4225c9367e140f130a3bd16d38 /crypto/cmp | |
parent | 44fde441937fc8db8ea6a7ac2e7c683ad9d5f8e0 (diff) |
check the return value of BIO_new() in t_x509.c:471 & cmp_vfy.c:36
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17175)
Diffstat (limited to 'crypto/cmp')
-rw-r--r-- | crypto/cmp/cmp_vfy.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/cmp/cmp_vfy.c b/crypto/cmp/cmp_vfy.c index d3d9cca0d4..d9fd23425b 100644 --- a/crypto/cmp/cmp_vfy.c +++ b/crypto/cmp/cmp_vfy.c @@ -34,7 +34,10 @@ static int verify_signature(const OSSL_CMP_CTX *cmp_ctx, return 0; bio = BIO_new(BIO_s_mem()); /* may be NULL */ - + if (bio == NULL) { + ERR_raise(ERR_LIB_CMP, ERR_R_MALLOC_FAILURE); + return 0; + } /* verify that keyUsage, if present, contains digitalSignature */ if (!cmp_ctx->ignore_keyusage && (X509_get_key_usage(cert) & X509v3_KU_DIGITAL_SIGNATURE) == 0) { |