summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_ciph.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-04-22 14:27:25 +0000
committertedu <tedu@openbsd.org>2014-04-22 14:27:25 +0000
commiteaf6beabbb0a3692c6722d49f93f1f1c68276ad0 (patch)
treea065b9fd9e5d9ddce54808570a65feed7ce637be /lib/libssl/ssl_ciph.c
parentchange mallocarray to reallocarray. useful in a few more situations. (diff)
downloadwireguard-openbsd-eaf6beabbb0a3692c6722d49f93f1f1c68276ad0.tar.xz
wireguard-openbsd-eaf6beabbb0a3692c6722d49f93f1f1c68276ad0.zip
switch to reallocarray
Diffstat (limited to 'lib/libssl/ssl_ciph.c')
-rw-r--r--lib/libssl/ssl_ciph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/ssl_ciph.c b/lib/libssl/ssl_ciph.c
index 070d6a10e5e..00ab752de1a 100644
--- a/lib/libssl/ssl_ciph.c
+++ b/lib/libssl/ssl_ciph.c
@@ -1328,7 +1328,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method,
#ifdef KSSL_DEBUG
printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers);
#endif /* KSSL_DEBUG */
- co_list = mallocarray(num_of_ciphers, sizeof(CIPHER_ORDER));
+ co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER));
if (co_list == NULL) {
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);
return(NULL); /* Failure */
@@ -1390,7 +1390,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method,
*/
num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER);
num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1;
- ca_list = mallocarray(num_of_alias_max, sizeof(SSL_CIPHER *));
+ ca_list = reallocarray(NULL, num_of_alias_max, sizeof(SSL_CIPHER *));
if (ca_list == NULL) {
free(co_list);
SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE);