[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Report deleted consensuses as NOT_FOUND rather than AVAILABLE



commit 2ca827104db2425bdb7f854c7b20d102706d559a
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue May 16 10:44:24 2017 -0400

    Report deleted consensuses as NOT_FOUND rather than AVAILABLE
    
    This bug happened because of a bogus pointer check in
    consdiffmgr_find_consensus(), not in any released Tor.
    
    Fixes CID 1409670.  Good catch, Coverity!
---
 src/or/consdiffmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c
index 72a4f01..a8df077 100644
--- a/src/or/consdiffmgr.c
+++ b/src/or/consdiffmgr.c
@@ -577,7 +577,7 @@ consdiffmgr_find_consensus(struct consensus_cache_entry_t **entry_out,
   if (!handle)
     return CONSDIFF_NOT_FOUND;
   *entry_out = consensus_cache_entry_handle_get(handle);
-  if (entry_out)
+  if (*entry_out)
     return CONSDIFF_AVAILABLE;
   else
     return CONSDIFF_NOT_FOUND;

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits