[tor-commits] [tor/release-0.3.1] Add another assertion to check for 24086 root causes

nickm at torproject.org nickm at torproject.org
Mon Dec 11 21:50:57 UTC 2017


commit 68c21860e32ca04d77c2bfbf7576b96de5110f59
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Nov 20 11:04:44 2017 -0500

    Add another assertion to check for 24086 root causes
    
    In cdm_diff_ht_set_status(), we shouldn't have been allowing the
    status CDM_DIFF_PRESENT to be set if there wasn't actually a handle.
---
 src/or/consdiffmgr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c
index 8c25ff201..c5f55b6f3 100644
--- a/src/or/consdiffmgr.c
+++ b/src/or/consdiffmgr.c
@@ -283,6 +283,10 @@ cdm_diff_ht_set_status(consensus_flavor_t flav,
                        int status,
                        consensus_cache_entry_handle_t *handle)
 {
+  if (handle == NULL) {
+    tor_assert_nonfatal(status != CDM_DIFF_PRESENT);
+  }
+
   struct cdm_diff_t search, *ent;
   memset(&search, 0, sizeof(cdm_diff_t));
   search.flavor = flav;





More information about the tor-commits mailing list