mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Stop spurious clang shallow analysis null pointer errors
Avoid 4 null pointer errors under clang shallow analysis (the default when building under Xcode) by using tor_assert() to prove that the pointers aren't null. Resolves issue 13284 via minor code refactoring.
This commit is contained in:
@@ -1395,6 +1395,8 @@ dirserv_compute_performance_thresholds(routerlist_t *rl,
|
||||
routerinfo_t *ri = node->ri;
|
||||
const char *id = node->identity;
|
||||
uint32_t bw_kb;
|
||||
/* resolve spurious clang shallow analysis null pointer errors */
|
||||
tor_assert(ri);
|
||||
node->is_exit = (!router_exit_policy_rejects_all(ri) &&
|
||||
exit_policy_is_general_exit(ri->exit_policy));
|
||||
uptimes[n_active] = (uint32_t)real_uptime(ri, now);
|
||||
|
||||
Reference in New Issue
Block a user