diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-25 08:59:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-25 08:59:08 -0400 |
commit | 0ef36626ea0b3735d06360fde27100d33f2f5462 (patch) | |
tree | 90209c1b1913d0ad5ccc5ba03275113a17d49ff0 /src/common/crypto_ed25519.c | |
parent | 5b7d4b0ceaf4ed3a3e9476cbae0defb9b2e13dea (diff) | |
download | tor-0ef36626ea0b3735d06360fde27100d33f2f5462.tar.gz tor-0ef36626ea0b3735d06360fde27100d33f2f5462.zip |
Use calloc, not malloc(a*b), in ed25519 batch signature check fn
[Not a triggerable bug unless somebody is going to go checking
millions+ of signatures in a single go.]
Diffstat (limited to 'src/common/crypto_ed25519.c')
-rw-r--r-- | src/common/crypto_ed25519.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c index c687a1b246..84c3eece6d 100644 --- a/src/common/crypto_ed25519.c +++ b/src/common/crypto_ed25519.c @@ -259,11 +259,11 @@ ed25519_checksig_batch(int *okay_out, int *oks; int all_ok; - ms = tor_malloc(sizeof(uint8_t*)*n_checkable); - lens = tor_malloc(sizeof(size_t)*n_checkable); - pks = tor_malloc(sizeof(uint8_t*)*n_checkable); - sigs = tor_malloc(sizeof(uint8_t*)*n_checkable); - oks = okay_out ? okay_out : tor_malloc(sizeof(int)*n_checkable); + ms = tor_calloc(n_checkable, sizeof(uint8_t*)); + lens = tor_calloc(n_checkable, sizeof(size_t)); + pks = tor_calloc(n_checkable, sizeof(uint8_t*)); + sigs = tor_calloc(n_checkable, sizeof(uint8_t*)); + oks = okay_out ? okay_out : tor_calloc(n_checkable, sizeof(int)); for (i = 0; i < n_checkable; ++i) { ms[i] = checkable[i].msg; |