mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Fix crash bug (3361) when setting off-flavor networkstatus
When we set a networkstatus in the non-preferred flavor, we'd check the time in the current_consensus. But that might have been NULL, which could produce a crash as seen in bug 3361.
This commit is contained in:
@@ -1814,7 +1814,7 @@ networkstatus_set_current_consensus(const char *consensus,
|
||||
* valid-after time, declare that our clock is skewed. */
|
||||
#define EARLY_CONSENSUS_NOTICE_SKEW 60
|
||||
|
||||
if (now < current_consensus->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {
|
||||
if (now < c->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {
|
||||
char tbuf[ISO_TIME_LEN+1];
|
||||
char dbuf[64];
|
||||
long delta = now - c->valid_after;
|
||||
|
||||
Reference in New Issue
Block a user