浏览代码

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.
Nick Mathewson 10 年之前
父节点
当前提交
7816ba8f1a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/common/crypto.c

+ 2 - 0
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;