Opened 7 weeks ago

Last modified 4 days ago

#22802 needs_review defect

Avoid use of "0" with tor_parse_foo()

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: review-group-22
Cc: catayst Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The tor_parse_long() functions and family can behave a little different on different platforms when the underlying strto* functions behave differently. This is exacerbated by use of bases other than 10, as we found on #22789. Let's stop using "base 0" (the 'autodetect' base) anywhere in our code.

Child Tickets

TicketStatusOwnerSummaryComponent
#22469newtor should probably reject "0x00" in port range specificationsCore Tor/Tor

Change History (7)

comment:1 Changed 6 weeks ago by teor

In #22469, tor accepts 0x00 as a port number in the torrc, despite it being against the spec. I wonder if we do the same thing when parsing ports in other contexts?

comment:2 in reply to:  1 ; Changed 9 days ago by nickm

Replying to teor:

In #22469, tor accepts 0x00 as a port number in the torrc, despite it being against the spec. I wonder if we do the same thing when parsing ports in other contexts?

I'm not sure we actually do that here -- looking over the tor_parse_* functions, I couldn't find any that would have caused #22469.

comment:3 Changed 9 days ago by nickm

Status: newneeds_review

I've fixed the cases I could see in bug22802.

I also cleaned up a bogus case in the windows tor_parse_uint64() implementation while I was there.

comment:4 in reply to:  2 Changed 8 days ago by catalyst

Cc: catayst added

Replying to nickm:

I'm not sure we actually do that here -- looking over the tor_parse_* functions, I couldn't find any that would have caused #22469.

Commented on #22469 about a possible cause.

comment:5 Changed 7 days ago by nickm

Owner: set to nickm
Status: needs_reviewassigned

setting owner

comment:6 Changed 7 days ago by nickm

Status: assignedneeds_review

comment:7 Changed 4 days ago by nickm

Keywords: review-group-22 added
Note: See TracTickets for help on using tickets.