summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/ec/ecp_nistp224.c4
-rw-r--r--src/lib/libssl/src/crypto/ec/ecp_nistp224.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp224.c b/src/lib/libcrypto/ec/ecp_nistp224.c
index afe25853e6..17777f517b 100644
--- a/src/lib/libcrypto/ec/ecp_nistp224.c
+++ b/src/lib/libcrypto/ec/ecp_nistp224.c
@@ -1437,9 +1437,11 @@ ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r,
1437 } 1437 }
1438 secrets = calloc(num_points, sizeof(felem_bytearray)); 1438 secrets = calloc(num_points, sizeof(felem_bytearray));
1439 pre_comp = calloc(num_points, 17 * 3 * sizeof(felem)); 1439 pre_comp = calloc(num_points, 17 * 3 * sizeof(felem));
1440 if (mixed) 1440 if (mixed) {
1441 /* XXX should do more int overflow checking */
1441 tmp_felems = reallocarray(NULL, 1442 tmp_felems = reallocarray(NULL,
1442 (num_points * 17 + 1), sizeof(felem)); 1443 (num_points * 17 + 1), sizeof(felem));
1444 }
1443 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) { 1445 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) {
1444 ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE); 1446 ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE);
1445 goto err; 1447 goto err;
diff --git a/src/lib/libssl/src/crypto/ec/ecp_nistp224.c b/src/lib/libssl/src/crypto/ec/ecp_nistp224.c
index afe25853e6..17777f517b 100644
--- a/src/lib/libssl/src/crypto/ec/ecp_nistp224.c
+++ b/src/lib/libssl/src/crypto/ec/ecp_nistp224.c
@@ -1437,9 +1437,11 @@ ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r,
1437 } 1437 }
1438 secrets = calloc(num_points, sizeof(felem_bytearray)); 1438 secrets = calloc(num_points, sizeof(felem_bytearray));
1439 pre_comp = calloc(num_points, 17 * 3 * sizeof(felem)); 1439 pre_comp = calloc(num_points, 17 * 3 * sizeof(felem));
1440 if (mixed) 1440 if (mixed) {
1441 /* XXX should do more int overflow checking */
1441 tmp_felems = reallocarray(NULL, 1442 tmp_felems = reallocarray(NULL,
1442 (num_points * 17 + 1), sizeof(felem)); 1443 (num_points * 17 + 1), sizeof(felem));
1444 }
1443 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) { 1445 if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) {
1444 ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE); 1446 ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE);
1445 goto err; 1447 goto err;