systemd/SOURCES/0593-openssl-use-new-char-size-instead-of-malloc-size.patch

26 lines
1000 B
Diff
Raw Normal View History

2024-04-30 11:42:21 +00:00
From bdd07d469eb24b566be3cf8e4dd972c01c9a878f Mon Sep 17 00:00:00 2001
From: Dan Streetman <ddstreet@ieee.org>
Date: Mon, 21 Aug 2023 18:14:07 -0400
Subject: [PATCH] openssl: use new(char, size) instead of malloc(size)
(cherry picked from commit b0307102951f57becf733f740710bc826e1609ba)
Related: RHEL-16182
---
src/shared/openssl-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/openssl-util.c b/src/shared/openssl-util.c
index c3f8f91eb3..313c1fc4ea 100644
--- a/src/shared/openssl-util.c
+++ b/src/shared/openssl-util.c
@@ -377,7 +377,7 @@ int ecc_pkey_to_curve_x_y(
if (!EVP_PKEY_get_utf8_string_param(pkey, OSSL_PKEY_PARAM_GROUP_NAME, NULL, 0, &name_size))
return log_debug_errno(SYNTHETIC_ERRNO(EIO), "Failed to get ECC group name size.");
- _cleanup_free_ char *name = malloc(name_size + 1);
+ _cleanup_free_ char *name = new(char, name_size + 1);
if (!name)
return log_oom_debug();