]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add assertions to crypto_dh_dup()
authorNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 16:27:22 +0000 (12:27 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 28 May 2015 16:27:22 +0000 (12:27 -0400)
Without these, coverity is annoyed that aren't checking for NULL in bench.c

CID 1293335 -- found by coverity.

src/common/crypto.c

index d77d5e20dc8b88aa3ae391eb9a1e3c680999926d..afaf93aed2fd3c364b2d47a22575d64d852f652b 100644 (file)
@@ -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;