From c626fda8a66a203d9f1435c34fcd3f7bda89d068 Mon Sep 17 00:00:00 2001 From: Frederik Wedel-Heinen Date: Sat, 21 Dec 2024 15:15:11 +0100 Subject: Check returns of various sk_*_push functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check returns of sk_POLICY_MAPPING_push, sk_GENERAL_NAME_push, sk_ACCESS_DESCRIPTION_push, sk_X509_push, sk_X509_NAME_push, sk_OPENSSL_CSTRING_push, sk_SCT_push, sk_DIST_POINT_push, sk_OSSL_CMP_CRLSTATUS_push, sk_ASN1_UTF8STRING_push and sk_ASN1_OBJECT_push and handle appropriately. Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26240) --- test/v3nametest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/v3nametest.c') diff --git a/test/v3nametest.c b/test/v3nametest.c index 3609eba045..73767abf46 100644 --- a/test/v3nametest.c +++ b/test/v3nametest.c @@ -157,7 +157,8 @@ static int set_altname(X509 *crt, ...) default: abort(); } - sk_GENERAL_NAME_push(gens, gen); + if (!sk_GENERAL_NAME_push(gens, gen)) + goto out; gen = NULL; } if (!X509_add1_ext_i2d(crt, NID_subject_alt_name, gens, 0, 0)) -- cgit v1.2.3