]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Work around test_status.c weirdness
authorNick Mathewson <nickm@torproject.org>
Tue, 3 Feb 2015 20:50:31 +0000 (15:50 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 3 Feb 2015 20:50:31 +0000 (15:50 -0500)
Ordinarily, get_options() can never return NULL, but with
test_status.c mocking, it can.  So test for that case.

The best fix here would be to pass the options value to a
bridge_server_mode() function.

src/or/status.c

index 98db688e5b6acf0efb51b4f09e39c49710bbdb97..8057abef16ff5e1cd6db89249c7f08e927fed4b9 100644 (file)
@@ -132,7 +132,7 @@ log_heartbeat(time_t now)
 
   circuit_log_ancient_one_hop_circuits(1800);
 
-  if (options->BridgeRelay) {
+  if (options && options->BridgeRelay) {
     char *msg = NULL;
     msg = format_client_stats_heartbeat(now);
     if (msg)