TorBulkExitList.py doesn't support all ports (patch included)
https://svn.torproject.org/svn/check/trunk/cgi-bin/TorBulkExitList.py
has this block:
# Verify that the port is a number between 1 and 65535
# Otherwise return a sane default of 80
search = re.compile("^(?:[1-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|"+\
"65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$")
The comment is wrong; unfortunately; the regex fails for 4-digit-or-less numbers that contain 0
, such as 8000
, 102
, or even 80
. The only reason it supports port 80 at all is because it's the default. It declares port 80 invalid and uses the default of port 80 instead.
The least invasive fix would be to replace the third line with:
search = re.compile("^(?:[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|"+\
Which makes the regex do what the comment suggests.
A better solution would be to use something other than a regex to determine if a number is in a range, but I'll leave that as an exercise for the reader. :P
Trac:
Username: Zarel