Opened 6 years ago

Closed 6 years ago

#14125 closed defect (fixed)

can't parse bandwidth file

Reported by: weasel Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version: Tor:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:



my authority is unable to correctly parse the bw file created by my bwauthority:

[warn] Incomplete line in bandwidth file: "node_id=$4BCE1492221439B9C836FF5129BB2B548DB0FEE6 bw=2760 nick=0snowden4president measured_at=1418733785 updated_at=1418733785 pid_error=-0.000288722464561 pid_error_sum=-0.000288722464561 pid_bw=2764001 pid_delta=-0.0532977795585 circ_fail=0.333333333333"
[warn] Incomplete line in bandwidth file: "\n"

Turns out that line is 256 chars long (including the \n). The buffer in dirserv_read_measured_bandwidths() - dirserv.c:2263 - is slightly too short to hold that.

Please consider using a longer char line[] there.

Child Tickets

Change History (2)

comment:1 Changed 6 years ago by Sebastian

Status: newneeds_review

I think we have no spec for the bw file, so we don't have a much better option than just increasing the buffer. I've put a trivial patch (based on 0.2.5.x because all dirauths run at least that) into bug14125 in my tpo repo.

comment:2 Changed 6 years ago by nickm

Milestone: Tor: 0.2.5.x-final
Resolution: fixed
Status: needs_reviewclosed

Merged to 0.2.5 and master. Thanks!

Note: See TracTickets for help on using tickets.