diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-11-18 10:51:23 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-11-18 10:51:23 -0500 |
commit | 43e0472fcfc3723e781d20ae3fb23e9f28e2ef50 (patch) | |
tree | a79d58a7493722749a5ad82cadc211aa67ff0e24 /src/or/dirvote.c | |
parent | 7813b0e0ed2313e6fe46175a2724adebcebd41a3 (diff) | |
download | tor-43e0472fcfc3723e781d20ae3fb23e9f28e2ef50.tar.gz tor-43e0472fcfc3723e781d20ae3fb23e9f28e2ef50.zip |
Move an assertion to make scan-build happy again.
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index ce82a5ef4a..6b806879a9 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -795,6 +795,9 @@ dirvote_compute_params(smartlist_t *votes, int method, int total_authorities) output = smartlist_new(); SMARTLIST_FOREACH_BEGIN(param_list, const char *, param) { + /* resolve spurious clang shallow analysis null pointer errors */ + tor_assert(param); + const char *next_param; int ok=0; eq = strchr(param, '='); @@ -807,8 +810,7 @@ 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 |