projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
912d7c7
)
Use OPENSSL_malloc rather than malloc/calloc
author
Richard Levitte
<levitte@openssl.org>
Tue, 24 Mar 2015 11:16:31 +0000
(12:16 +0100)
committer
Richard Levitte
<levitte@openssl.org>
Tue, 24 Mar 2015 11:21:12 +0000
(12:21 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/engine/eng_cryptodev.c
patch
|
blob
|
history
diff --git
a/crypto/engine/eng_cryptodev.c
b/crypto/engine/eng_cryptodev.c
index 6f66254c9e2233ef8ea129fca972eea04c773951..d005e017e416c7fd28f2f64cad15cb21081473d9 100644
(file)
--- a/
crypto/engine/eng_cryptodev.c
+++ b/
crypto/engine/eng_cryptodev.c
@@
-1022,9
+1022,10
@@
static int bn2crparam(const BIGNUM *a, struct crparam *crp)
bits = BN_num_bits(a);
bytes = BN_num_bytes(a);
- b =
calloc(bytes,1
);
+ b =
OPENSSL_malloc(bytes
);
if (b == NULL)
return (1);
+ memset(b, 0, bytes);
crp->crp_p = (caddr_t) b;
crp->crp_nbits = bits;
@@
-1044,7
+1045,7
@@
static int crparam2bn(struct crparam *crp, BIGNUM *a)
if (bytes == 0)
return (-1);
- if ((pd = (u_int8_t *) malloc(bytes)) == NULL)
+ if ((pd = (u_int8_t *)
OPENSSL_
malloc(bytes)) == NULL)
return (-1);
for (i = 0; i < bytes; i++)