From: Jiasheng Jiang Date: Wed, 15 Jun 2022 07:37:36 +0000 (+0800) Subject: test/v3nametest.c: Add check for OPENSSL_malloc X-Git-Tag: openssl-3.2.0-alpha1~2498 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b147b9daf17744d529f23b5da40397a6071a88aa;p=thirdparty%2Fopenssl.git test/v3nametest.c: Add check for OPENSSL_malloc As the potential failure of the OPENSSL_malloc(), it should be better to add the check and return error if fails. Signed-off-by: Jiasheng Jiang Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/18573) --- diff --git a/test/v3nametest.c b/test/v3nametest.c index a1998550e29..6d2e2f8e270 100644 --- a/test/v3nametest.c +++ b/test/v3nametest.c @@ -288,6 +288,8 @@ static int run_cert(X509 *crt, const char *nameincert, char *name = OPENSSL_malloc(namelen + 1); int match, ret; + if (!TEST_ptr(name)) + return 0; memcpy(name, *pname, namelen + 1); match = -1;