diff options
author | tedu <> | 2014-04-22 14:27:25 +0000 |
---|---|---|
committer | tedu <> | 2014-04-22 14:27:25 +0000 |
commit | 8f37609d35ff6159735e8fe51c0983379e72574b (patch) | |
tree | d91238c3e56bb6f5e246b283ea7ded6d3aa990b9 /src | |
parent | 5c557d38ed349266c22bfdf0d800f6e873921885 (diff) | |
download | openbsd-8f37609d35ff6159735e8fe51c0983379e72574b.tar.gz openbsd-8f37609d35ff6159735e8fe51c0983379e72574b.tar.bz2 openbsd-8f37609d35ff6159735e8fe51c0983379e72574b.zip |
switch to reallocarray
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/src/ssl/ssl_ciph.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/ssl_ciph.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libssl/src/ssl/ssl_ciph.c b/src/lib/libssl/src/ssl/ssl_ciph.c index 070d6a10e5..00ab752de1 100644 --- a/src/lib/libssl/src/ssl/ssl_ciph.c +++ b/src/lib/libssl/src/ssl/ssl_ciph.c | |||
@@ -1328,7 +1328,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
1328 | #ifdef KSSL_DEBUG | 1328 | #ifdef KSSL_DEBUG |
1329 | printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers); | 1329 | printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers); |
1330 | #endif /* KSSL_DEBUG */ | 1330 | #endif /* KSSL_DEBUG */ |
1331 | co_list = mallocarray(num_of_ciphers, sizeof(CIPHER_ORDER)); | 1331 | co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER)); |
1332 | if (co_list == NULL) { | 1332 | if (co_list == NULL) { |
1333 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); | 1333 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); |
1334 | return(NULL); /* Failure */ | 1334 | return(NULL); /* Failure */ |
@@ -1390,7 +1390,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
1390 | */ | 1390 | */ |
1391 | num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER); | 1391 | num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER); |
1392 | num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1; | 1392 | num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1; |
1393 | ca_list = mallocarray(num_of_alias_max, sizeof(SSL_CIPHER *)); | 1393 | ca_list = reallocarray(NULL, num_of_alias_max, sizeof(SSL_CIPHER *)); |
1394 | if (ca_list == NULL) { | 1394 | if (ca_list == NULL) { |
1395 | free(co_list); | 1395 | free(co_list); |
1396 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); | 1396 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); |
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c index 070d6a10e5..00ab752de1 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/lib/libssl/ssl_ciph.c | |||
@@ -1328,7 +1328,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
1328 | #ifdef KSSL_DEBUG | 1328 | #ifdef KSSL_DEBUG |
1329 | printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers); | 1329 | printf("ssl_create_cipher_list() for %d ciphers\n", num_of_ciphers); |
1330 | #endif /* KSSL_DEBUG */ | 1330 | #endif /* KSSL_DEBUG */ |
1331 | co_list = mallocarray(num_of_ciphers, sizeof(CIPHER_ORDER)); | 1331 | co_list = reallocarray(NULL, num_of_ciphers, sizeof(CIPHER_ORDER)); |
1332 | if (co_list == NULL) { | 1332 | if (co_list == NULL) { |
1333 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); | 1333 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); |
1334 | return(NULL); /* Failure */ | 1334 | return(NULL); /* Failure */ |
@@ -1390,7 +1390,7 @@ ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
1390 | */ | 1390 | */ |
1391 | num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER); | 1391 | num_of_group_aliases = sizeof(cipher_aliases) / sizeof(SSL_CIPHER); |
1392 | num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1; | 1392 | num_of_alias_max = num_of_ciphers + num_of_group_aliases + 1; |
1393 | ca_list = mallocarray(num_of_alias_max, sizeof(SSL_CIPHER *)); | 1393 | ca_list = reallocarray(NULL, num_of_alias_max, sizeof(SSL_CIPHER *)); |
1394 | if (ca_list == NULL) { | 1394 | if (ca_list == NULL) { |
1395 | free(co_list); | 1395 | free(co_list); |
1396 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); | 1396 | SSLerr(SSL_F_SSL_CREATE_CIPHER_LIST, ERR_R_MALLOC_FAILURE); |