Opened 2 years ago

Closed 2 years ago

#21964 closed defect (fixed)

Consdiff code accepts non-numbers in ranges

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

Description

Ranges like "1, +15" are totally accepted.

Child Tickets

Change History (6)

comment:1 Changed 2 years ago by nickm

I'd take a fix for this in 0.3.1 if somebody writes one. The fix is probably to tweak get_linenum() in consdiff.c to take only digits; not sure if we already have a numeric parsing function that does that.

comment:2 Changed 2 years ago by Sebastian

Status: newneeds_review

branch consdiff_numeric in my repo

comment:3 Changed 2 years ago by Sebastian

Milestone: Tor: 0.3.2.x-finalTor: 0.3.1.x-final

comment:4 Changed 2 years ago by nickm

Hm. Is it sufficient to check only the first character? I guess maybe it is. But if so, we should really use TOR_ISDIGIT.

comment:5 Changed 2 years ago by Sebastian

I think it is sufficient, I addded some more tests demonstrating that. Let me know if there's any more tests you think I should add. I pushed a fixup commit using TOR_ISDIGIT, thanks for that suggestion.

comment:6 Changed 2 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Makes sense; squashed and merged!

Note: See TracTickets for help on using tickets.