mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
Segfault less during consensus generation without params
If no authority votes on any params, Tor authorities segfault when trying to make a new consensus from the votes. Let's change that.
This commit is contained in:
parent
28cda33299
commit
cae769d646
@ -0,0 +1,5 @@
|
|||||||
|
o Minor bugfixes:
|
||||||
|
- When none of the authorities vote on any params, Tor segfaults when
|
||||||
|
trying to make the consensus from the votes. This is currently
|
||||||
|
not critical, because authorities do include params in their votes.
|
||||||
|
Bugfix on 0.2.2.10-alpha, fixes bug 1322.
|
@ -1757,10 +1757,12 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
|||||||
// Parse params, extract BW_WEIGHT_SCALE if present
|
// Parse params, extract BW_WEIGHT_SCALE if present
|
||||||
// DO NOT use consensus_param_bw_weight_scale() in this code!
|
// DO NOT use consensus_param_bw_weight_scale() in this code!
|
||||||
// The consensus is not formed yet!
|
// The consensus is not formed yet!
|
||||||
|
if (params) {
|
||||||
if (strcmpstart(params, "bwweightscale=") == 0)
|
if (strcmpstart(params, "bwweightscale=") == 0)
|
||||||
bw_weight_param = params;
|
bw_weight_param = params;
|
||||||
else
|
else
|
||||||
bw_weight_param = strstr(params, " bwweightscale=");
|
bw_weight_param = strstr(params, " bwweightscale=");
|
||||||
|
}
|
||||||
|
|
||||||
if (bw_weight_param) {
|
if (bw_weight_param) {
|
||||||
int ok=0;
|
int ok=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user