Opened 6 years ago

Closed 6 years ago

#11342 closed defect (fixed)

dump_desc() can trigger "write_str_to_file(): Bug: We're writing a text string that already contains a CR" on Windows

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: 0.2.5.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client 025-triaged 024-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

dump_desc() calls write_str_to_file() with bin==0, which on Windows causes an LD_BUG warn if the thing you're writing has a \r in it.

In this case, we're writing the thing because it came from the network and we couldn't parse it. So we could totally give a Windows relay or client a thing that they can't parse which has a \r in it, causing this LD_BUG log to trigger.

Noticed by looking at #11233. Unclear if it's the same location as was triggered in that bug though.

Child Tickets

Change History (4)

comment:1 Changed 6 years ago by nickm

Keywords: tor-client 025-triaged added

comment:2 Changed 6 years ago by nickm

Keywords: 024-backport added
Status: newneeds_review

Branch "bug11342" in my public repo should apply cleanly to maint-0.2.4 and to master.

comment:3 Changed 6 years ago by arma

Looks good to me. I think it's the sort of thing that can skip 0.2.4 and go just into master.

comment:4 Changed 6 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged to master; thanks for the review

Note: See TracTickets for help on using tickets.