diff options
| author | deraadt <> | 2014-05-29 21:07:43 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-05-29 21:07:43 +0000 |
| commit | 642d45ae22413aa8195b105d051ca8896e782c5d (patch) | |
| tree | d5fe0c330801f3e72c7b588264c6027636db4330 /src/lib/libcrypto/ec/ecp_smpl.c | |
| parent | f60b3b3365842d8869513a7e36981671cd726939 (diff) | |
| download | openbsd-642d45ae22413aa8195b105d051ca8896e782c5d.tar.gz openbsd-642d45ae22413aa8195b105d051ca8896e782c5d.tar.bz2 openbsd-642d45ae22413aa8195b105d051ca8896e782c5d.zip | |
convert 53 malloc(a*b) to reallocarray(NULL, a, b). that is 53
potential integer overflows easily changed into an allocation return
of NULL, with errno nicely set if need be. checks for an allocations
returning NULL are commonplace, or if the object is dereferenced
(quite normal) will result in a nice fault which can be detected &
repaired properly.
ok tedu
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_smpl.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_smpl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c index b87410120d..46783a47a8 100644 --- a/src/lib/libcrypto/ec/ecp_smpl.c +++ b/src/lib/libcrypto/ec/ecp_smpl.c | |||
| @@ -1257,7 +1257,7 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * | |||
| 1257 | */ | 1257 | */ |
| 1258 | pow2 <<= 1; | 1258 | pow2 <<= 1; |
| 1259 | 1259 | ||
| 1260 | heap = malloc(pow2 * sizeof heap[0]); | 1260 | heap = reallocarray(NULL, pow2, sizeof heap[0]); |
| 1261 | if (heap == NULL) | 1261 | if (heap == NULL) |
| 1262 | goto err; | 1262 | goto err; |
| 1263 | 1263 | ||
