diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-05-28 12:27:22 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-05-28 12:27:22 -0400 |
commit | 7816ba8f1a3381d28d78aa7812f1c26edd7cdd0e (patch) | |
tree | 745b00beea728d4d9fd4743a6fd754e1b6641170 /src/common/crypto.c | |
parent | a194385d5619f2b9c03ada34b8a7291ccc3c21ca (diff) | |
download | tor-7816ba8f1a3381d28d78aa7812f1c26edd7cdd0e.tar.gz tor-7816ba8f1a3381d28d78aa7812f1c26edd7cdd0e.zip |
Add assertions to crypto_dh_dup()
Without these, coverity is annoyed that aren't checking for NULL in bench.c
CID 1293335 -- found by coverity.
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index d77d5e20dc..afaf93aed2 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1979,6 +1979,8 @@ crypto_dh_t * crypto_dh_dup(const crypto_dh_t *dh) { crypto_dh_t *dh_new = tor_malloc_zero(sizeof(crypto_dh_t)); + tor_assert(dh); + tor_assert(dh->dh); dh_new->dh = dh->dh; DH_up_ref(dh->dh); return dh_new; |