]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add another assertion to check for 24086 root causes
authorNick Mathewson <nickm@torproject.org>
Mon, 20 Nov 2017 16:04:44 +0000 (11:04 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 20 Nov 2017 16:06:31 +0000 (11:06 -0500)
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

index 8c25ff201cb636e5233784f0380b3c34dc927404..c5f55b6f3ffc9d638c32cc3edd82fd7fa266c118 100644 (file)
@@ -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;