]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ssl: drop multiplication by sizeof(char) in allocation size calculations
authorEugene Syromiatnikov <esyr@openssl.org>
Thu, 17 Jul 2025 08:41:07 +0000 (10:41 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 8 Aug 2025 16:22:10 +0000 (12:22 -0400)
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28059)

ssl/t1_lib.c

index 96bbbdb8768b2e1656206c2a62c53156182da116..0e245b1c27e49ddeeebff81673d2db39b4e45856 100644 (file)
@@ -1334,9 +1334,10 @@ static int gid_cb(const char *elem, int len, void *arg)
                      * First, we restore any keyshare prefix in a new zero-terminated string
                      * (if not already present)
                      */
-                    restored_default_group_string = OPENSSL_malloc((1 /* max prefix length */ +
-                                                                    strlen(default_group_strings[i].group_string) +
-                                                                    1 /* \0 */) * sizeof(char));
+                    restored_default_group_string =
+                        OPENSSL_malloc(1 /* max prefix length */ +
+                                       strlen(default_group_strings[i].group_string) +
+                                       1 /* \0 */);
                     if (restored_default_group_string == NULL)
                         return 0;
                     if (add_keyshare
@@ -1552,7 +1553,7 @@ static int tuple_cb(const char *tuple, int len, void *arg)
     }
 
     /* Convert to \0-terminated string */
-    restored_tuple_string = OPENSSL_malloc((len + 1 /* \0 */) * sizeof(char));
+    restored_tuple_string = OPENSSL_malloc(len + 1 /* \0 */);
     if (restored_tuple_string == NULL)
         return 0;
     memcpy(restored_tuple_string, tuple, len);