Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 345
    • Issues 345
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 35
    • Merge requests 35
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Merge requests
  • !168

net: Reject invalid characters in port ranges

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed c requested to merge c/tor:c/ticket-22469 into main Oct 09, 2020
  • Overview 7
  • Commits 2
  • Pipelines 2
  • Changes 1

Fixes issue #22469 (closed) where port strings such as '0x00' get accepted, not because the string gets converted to hex, but because the string is silently truncated past the invalid character 'x'. This also causes issues for strings such as '0x01-0x02' which look like a hex port range, but in reality gets truncated to '0', which is definitely not what a user intends.

Warn and reject such port strings as invalid.

Also, since we're throwing that "malformed port" warning a lot in the function, wrap it up in a nice goto.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: c/ticket-22469