diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_nistp521.c')
-rw-r--r-- | src/lib/libcrypto/ec/ecp_nistp521.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ecp_nistp521.c b/src/lib/libcrypto/ec/ecp_nistp521.c index 6792c5b71d..083e017cdc 100644 --- a/src/lib/libcrypto/ec/ecp_nistp521.c +++ b/src/lib/libcrypto/ec/ecp_nistp521.c | |||
@@ -1874,8 +1874,11 @@ ec_GFp_nistp521_points_mul(const EC_GROUP * group, EC_POINT * r, | |||
1874 | } | 1874 | } |
1875 | secrets = calloc(num_points, sizeof(felem_bytearray)); | 1875 | secrets = calloc(num_points, sizeof(felem_bytearray)); |
1876 | pre_comp = calloc(num_points, 17 * 3 * sizeof(felem)); | 1876 | pre_comp = calloc(num_points, 17 * 3 * sizeof(felem)); |
1877 | if (mixed) | 1877 | if (mixed) { |
1878 | tmp_felems = malloc((num_points * 17 + 1) * sizeof(felem)); | 1878 | /* XXX should do more int overflow checking */ |
1879 | tmp_felems = reallocarray(NULL, | ||
1880 | (num_points * 17 + 1), sizeof(felem)); | ||
1881 | } | ||
1879 | if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) { | 1882 | if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) { |
1880 | ECerr(EC_F_EC_GFP_NISTP521_POINTS_MUL, ERR_R_MALLOC_FAILURE); | 1883 | ECerr(EC_F_EC_GFP_NISTP521_POINTS_MUL, ERR_R_MALLOC_FAILURE); |
1881 | goto err; | 1884 | goto err; |