diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-06-29 10:43:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-06-29 10:43:50 -0400 |
commit | 2c718c1a12f06bdaa9c735a8d201c20b7ca4cfac (patch) | |
tree | e99fb90b8e8ab87d3d9ce819c473e4d5a4d1f4ad /src/or | |
parent | bb5968cae19d46eb4d45123146efacf0477a9d2c (diff) | |
parent | 0ac8f0bde92ef60d8863bbbcae42a6dc7c726b01 (diff) | |
download | tor-2c718c1a12f06bdaa9c735a8d201c20b7ca4cfac.tar.gz tor-2c718c1a12f06bdaa9c735a8d201c20b7ca4cfac.zip |
Merge branch 'maint-0.3.1'
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/consdiffmgr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c index 4036f665f9..638fcd6794 100644 --- a/src/or/consdiffmgr.c +++ b/src/or/consdiffmgr.c @@ -325,7 +325,8 @@ cdm_diff_ht_purge(consensus_flavor_t flav, if ((*diff)->cdm_diff_status == CDM_DIFF_PRESENT && flav == (*diff)->flavor) { - if (consensus_cache_entry_handle_get((*diff)->entry) == NULL) { + if (BUG((*diff)->entry == NULL) || + consensus_cache_entry_handle_get((*diff)->entry) == NULL) { /* the underlying entry has gone away; drop this. */ next = HT_NEXT_RMV(cdm_diff_ht, &cdm_diff_ht, diff); cdm_diff_free(this); @@ -622,6 +623,9 @@ consdiffmgr_find_diff_from(consensus_cache_entry_t **entry_out, return CONSDIFF_IN_PROGRESS; } + if (BUG(ent->entry == NULL)) { + return CONSDIFF_NOT_FOUND; + } *entry_out = consensus_cache_entry_handle_get(ent->entry); return (*entry_out) ? CONSDIFF_AVAILABLE : CONSDIFF_NOT_FOUND; |