From ff8fe38a2fac97d34bba4d46edabb4dd1bbe6d90 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 29 Sep 2014 10:08:37 +1000 Subject: 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. --- src/or/dirvote.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/or/dirvote.c') diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 9ad92ca116..8a0fdf62fc 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -647,6 +647,8 @@ dirvote_compute_params(smartlist_t *votes, int method, int total_authorities) next_param = NULL; else next_param = smartlist_get(param_list, param_sl_idx+1); + /* resolve spurious clang shallow analysis null pointer errors */ + tor_assert(param); if (!next_param || strncmp(next_param, param, cur_param_len)) { /* We've reached the end of a series. */ /* Make sure enough authorities voted on this param, unless the -- cgit v1.2.3-54-g00ecf