diff options
author | teor <teor2345@gmail.com> | 2017-09-15 14:02:22 +1000 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2017-09-15 14:02:22 +1000 |
commit | 033691212a49d3d32f8a684a493c8c11b8887eee (patch) | |
tree | 73239f2ea873e954533a72c3a7e664e396024f4a /src/or/bridges.c | |
parent | d60e7df2da5bfae62750bc4b41581d47e504e4bf (diff) | |
download | tor-033691212a49d3d32f8a684a493c8c11b8887eee.tar.gz tor-033691212a49d3d32f8a684a493c8c11b8887eee.zip |
Make an assert into a BUG warning in the bridge code
If future code asks if there are any running bridges, without checking
if bridges are enabled, log a BUG warning rather than crashing.
Fixes 23524 on 0.3.0.1-alpha
Diffstat (limited to 'src/or/bridges.c')
-rw-r--r-- | src/or/bridges.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c index 812b0ddce8..1eec4e39ec 100644 --- a/src/or/bridges.c +++ b/src/or/bridges.c @@ -836,7 +836,9 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cache) MOCK_IMPL(int, any_bridge_descriptors_known, (void)) { - tor_assert(get_options()->UseBridges); + if (BUG(!get_options()->UseBridges)) { + return 0; + } if (!bridge_list) return 0; |