summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r--src/lib/libcrypto/asn1/a_set.c2
-rw-r--r--src/lib/libcrypto/asn1/tasn_enc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c
index 3aeb7e54ff..8101f7722d 100644
--- a/src/lib/libcrypto/asn1/a_set.c
+++ b/src/lib/libcrypto/asn1/a_set.c
@@ -121,7 +121,7 @@ i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, i2d_of_void *i2d,
121 121
122 pStart = p; /* Catch the beg of Setblobs*/ 122 pStart = p; /* Catch the beg of Setblobs*/
123 /* In this array we will store the SET blobs */ 123 /* In this array we will store the SET blobs */
124 rgSetBlob = malloc(sk_OPENSSL_BLOCK_num(a) * sizeof(MYBLOB)); 124 rgSetBlob = reallocarray(NULL, sk_OPENSSL_BLOCK_num(a), sizeof(MYBLOB));
125 if (rgSetBlob == NULL) { 125 if (rgSetBlob == NULL) {
126 ASN1err(ASN1_F_I2D_ASN1_SET, ERR_R_MALLOC_FAILURE); 126 ASN1err(ASN1_F_I2D_ASN1_SET, ERR_R_MALLOC_FAILURE);
127 return 0; 127 return 0;
diff --git a/src/lib/libcrypto/asn1/tasn_enc.c b/src/lib/libcrypto/asn1/tasn_enc.c
index f5fc8820f6..cfceabe5a9 100644
--- a/src/lib/libcrypto/asn1/tasn_enc.c
+++ b/src/lib/libcrypto/asn1/tasn_enc.c
@@ -435,7 +435,7 @@ asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, int skcontlen,
435 if (sk_ASN1_VALUE_num(sk) < 2) 435 if (sk_ASN1_VALUE_num(sk) < 2)
436 do_sort = 0; 436 do_sort = 0;
437 else { 437 else {
438 derlst = malloc(sk_ASN1_VALUE_num(sk) * 438 derlst = reallocarray(NULL, sk_ASN1_VALUE_num(sk),
439 sizeof(*derlst)); 439 sizeof(*derlst));
440 tmpdat = malloc(skcontlen); 440 tmpdat = malloc(skcontlen);
441 if (!derlst || !tmpdat) { 441 if (!derlst || !tmpdat) {