diff options
author | xkernel <xkernel.wang@foxmail.com> | 2022-07-11 09:12:00 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-07-14 14:08:51 +0200 |
commit | ea809510f69e5aebc2ab95aa7530e01060e8a960 (patch) | |
tree | 858e1ca58da392e3d52ef1464e89453f97ec82af | |
parent | Fix EC ASM flag passing (diff) | |
download | openssl-ea809510f69e5aebc2ab95aa7530e01060e8a960.tar.xz openssl-ea809510f69e5aebc2ab95aa7530e01060e8a960.zip |
ocspapitest: properly check the return of memory-allocating functions
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18774)
-rw-r--r-- | test/ocspapitest.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/ocspapitest.c b/test/ocspapitest.c index 9e8c306259..7142f50831 100644 --- a/test/ocspapitest.c +++ b/test/ocspapitest.c @@ -78,7 +78,10 @@ static OCSP_BASICRESP *make_dummy_resp(void) ASN1_BIT_STRING *key = ASN1_BIT_STRING_new(); ASN1_INTEGER *serial = ASN1_INTEGER_new(); - if (!X509_NAME_add_entry_by_NID(name, NID_commonName, MBSTRING_ASC, + if (!TEST_ptr(name) + || !TEST_ptr(key) + || !TEST_ptr(serial) + || !X509_NAME_add_entry_by_NID(name, NID_commonName, MBSTRING_ASC, namestr, -1, -1, 1) || !ASN1_BIT_STRING_set(key, keybytes, sizeof(keybytes)) || !ASN1_INTEGER_set_uint64(serial, (uint64_t)1)) |