diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-08-25 14:28:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-26 10:56:51 -0700 |
commit | d97a3855350aacd1ea776506624171952fab8ed8 (patch) | |
tree | cc2c9cfe6ea39246aaf0860ca1704b95cf694841 /src/or | |
parent | a3e82563df3b549a36a49a4efdb2f1aeef0e0b07 (diff) | |
download | tor-d97a3855350aacd1ea776506624171952fab8ed8.tar.gz tor-d97a3855350aacd1ea776506624171952fab8ed8.zip |
Workaround a test bug
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/protover.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/protover.c b/src/or/protover.c index 7314d61b60..7feec0c5c7 100644 --- a/src/or/protover.c +++ b/src/or/protover.c @@ -392,6 +392,8 @@ contract_protocol_list(const smartlist_t *proto_strings) // Parse each item and stick it entry_lists_by_name. Build // 'all_names' at the same time. SMARTLIST_FOREACH_BEGIN(proto_strings, const char *, s) { + if (BUG(!s)) + continue;// LCOV_EXCL_LINE proto_entry_t *ent = parse_single_entry(s, s+strlen(s)); if (BUG(!ent)) continue; // LCOV_EXCL_LINE @@ -513,14 +515,14 @@ compute_protover_vote(const smartlist_t *list_of_proto_strings, if (!strcmp(ent, cur_entry)) { n_times++; } else { - if (n_times >= threshold) + if (n_times >= threshold && cur_entry) smartlist_add(include_entries, (void*)cur_entry); cur_entry = ent; n_times = 1 ; } } SMARTLIST_FOREACH_END(ent); - if (n_times >= threshold) + if (n_times >= threshold && cur_entry) smartlist_add(include_entries, (void*)cur_entry); // Finally, compress that list. |