From: Tomas Mraz Date: Wed, 5 Feb 2025 07:51:43 +0000 (+0100) Subject: ossl_rand_ctx_new(): Use OPENSSL_strdup instead of strdup X-Git-Tag: openssl-3.5.0-alpha1~622 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd177b776ce95a435fc1653e328380c7f1a638c;p=thirdparty%2Fopenssl.git ossl_rand_ctx_new(): Use OPENSSL_strdup instead of strdup Fixes Coverity 1642620 Reviewed-by: Neil Horman Reviewed-by: Dmitry Belyavskiy Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/26641) --- diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index 566504f3ff1..eb8472626aa 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -528,7 +528,7 @@ void *ossl_rand_ctx_new(OSSL_LIB_CTX *libctx) OPENSSL_init_crypto(OPENSSL_INIT_BASE_ONLY, NULL); /* Prepopulate the random provider name */ - dgbl->random_provider_name = strdup(random_provider_fips_name); + dgbl->random_provider_name = OPENSSL_strdup(random_provider_fips_name); if (dgbl->random_provider_name == NULL) goto err0; #endif