summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-05-31 18:49:47 +0000
committerderaadt <deraadt@openbsd.org>2014-05-31 18:49:47 +0000
commit537c4b60f7b6de0bcbd778583c1ee0ef7a2d5e4f (patch)
tree25e56e318ddf8ace89096eb34b34735670bdca90 /lib
parentSome KNF and fix the vairable spelling. (diff)
downloadwireguard-openbsd-537c4b60f7b6de0bcbd778583c1ee0ef7a2d5e4f.tar.xz
wireguard-openbsd-537c4b60f7b6de0bcbd778583c1ee0ef7a2d5e4f.zip
copy a comment placed in other files; req from miod
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ec/ecp_nistp224.c4
-rw-r--r--lib/libssl/src/crypto/ec/ecp_nistp224.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/libcrypto/ec/ecp_nistp224.c b/lib/libcrypto/ec/ecp_nistp224.c
index afe25853e6b..17777f517b7 100644
--- a/lib/libcrypto/ec/ecp_nistp224.c
+++ b/lib/libcrypto/ec/ecp_nistp224.c
@@ -1437,9 +1437,11 @@ ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r,
}
secrets = calloc(num_points, sizeof(felem_bytearray));
pre_comp = calloc(num_points, 17 * 3 * sizeof(felem));
- if (mixed)
+ if (mixed) {
+ /* XXX should do more int overflow checking */
tmp_felems = reallocarray(NULL,
(num_points * 17 + 1), sizeof(felem));
+ }
if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) {
ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE);
goto err;
diff --git a/lib/libssl/src/crypto/ec/ecp_nistp224.c b/lib/libssl/src/crypto/ec/ecp_nistp224.c
index afe25853e6b..17777f517b7 100644
--- a/lib/libssl/src/crypto/ec/ecp_nistp224.c
+++ b/lib/libssl/src/crypto/ec/ecp_nistp224.c
@@ -1437,9 +1437,11 @@ ec_GFp_nistp224_points_mul(const EC_GROUP * group, EC_POINT * r,
}
secrets = calloc(num_points, sizeof(felem_bytearray));
pre_comp = calloc(num_points, 17 * 3 * sizeof(felem));
- if (mixed)
+ if (mixed) {
+ /* XXX should do more int overflow checking */
tmp_felems = reallocarray(NULL,
(num_points * 17 + 1), sizeof(felem));
+ }
if ((secrets == NULL) || (pre_comp == NULL) || (mixed && (tmp_felems == NULL))) {
ECerr(EC_F_EC_GFP_NISTP224_POINTS_MUL, ERR_R_MALLOC_FAILURE);
goto err;