Three more errors turned up with fuzzing.

These are fixed in netlib, regression tests added here.
This commit is contained in:
Aldo Cortesi 2013-03-03 15:14:49 +13:00
parent 7835e0c2c7
commit 8216801728
2 changed files with 18 additions and 3 deletions

View File

@ -3,7 +3,7 @@
# mitmproxy/mitmdump is running on port 8080 in straight proxy mode.
# pathod is running on port 9999
BASE="/Users/aldo/git/public/pathod/venv/bin/pathoc -eo -I 200,400,502 -p 8080 localhost "
$BASE -n 1000 "get:'http://localhost:9999':ir,@1"
BASE="/Users/aldo/git/public/pathod/venv/bin/pathoc -eo -I 200,400,405,502 -p 8080 localhost "
$BASE -n 10000 "get:'http://localhost:9999':ir,@1"

View File

@ -1,7 +1,8 @@
import tservers
"""
A collection of errors turned up by fuzzing.
A collection of errors turned up by fuzzing. Errors are integrated here
after being fixed to check for regressions.
"""
class TestFuzzy(tservers.HTTPProxTest):
@ -10,3 +11,17 @@ class TestFuzzy(tservers.HTTPProxTest):
p = self.pathoc()
assert p.request(req%self.server.port).status_code == 400
def test_nullbytes(self):
req = r'get:"http://localhost:%s":i19,"\x00"'
p = self.pathoc()
assert p.request(req%self.server.port).status_code == 400
def test_invalid_ports(self):
req = 'get:"http://localhost:999999"'
p = self.pathoc()
assert p.request(req).status_code == 400
def test_invalid_ipv6_url(self):
req = 'get:"http://localhost:%s":i13,"["'
p = self.pathoc()
assert p.request(req%self.server.port).status_code == 400