diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-10-26 17:58:36 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-10-26 17:58:36 +1300 |
commit | 16654ad6a4ba4f12287d5707dafe3794b6e33fb8 (patch) | |
tree | c4bb04d3f8070272589775fdc53fc0f40ce63340 /test/fuzzing | |
parent | 7aee9a7c311e755147b398b8ba0b44aaec40eaf7 (diff) | |
download | mitmproxy-16654ad6a4ba4f12287d5707dafe3794b6e33fb8.tar.gz mitmproxy-16654ad6a4ba4f12287d5707dafe3794b6e33fb8.tar.bz2 mitmproxy-16654ad6a4ba4f12287d5707dafe3794b6e33fb8.zip |
Fix crash while streaming
Found using fuzzing. Reproduction with pathoc, given "mitmproxy -s" and
pathod running on 9999:
get:'http://localhost:9999/p/':s'200:b\'foo\':h\'Content-Length\'=\'3\'':i58,'\x1a':r
return flow.FlowMaster.run(self)
File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/controller.py", line 111, in run
self.tick(self.masterq, 0.01)
File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/flow.py", line 613, in tick
return controller.Master.tick(self, q, timeout)
File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/controller.py", line 101, in tick
self.handle(*msg)
File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/controller.py", line 118, in handle
m(obj)
File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/flow.py", line 738, in handle_responseheaders
self.stream_large_bodies.run(f, False)
File "/Users/aldo/mitmproxy/mitmproxy/libmproxy/flow.py", line 155, in run
r.headers, is_request, flow.request.method, code
File "/Users/aldo/mitmproxy/mitmproxy/netlib/http.py", line 401, in expected_http_body_size
raise HttpError(400 if is_request else 502, "Invalid content-length header: %s" % headers["content-length"])
netlib.http.HttpError: Invalid content-length header: ['\x1a3']
Diffstat (limited to 'test/fuzzing')
-rw-r--r-- | test/fuzzing/straight_stream | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/fuzzing/straight_stream b/test/fuzzing/straight_stream index 64feae45..a716a085 100644 --- a/test/fuzzing/straight_stream +++ b/test/fuzzing/straight_stream @@ -1,4 +1,6 @@ mitmdump: $MITMDUMP -q --stream 1 pathod: $PATHOD -q -pathoc: sleep 2 && $PATHOC $FUZZ_SETTINGS localhost:8080 ./straight_stream_patterns
\ No newline at end of file +#pathoc: sleep 2 && $PATHOC $FUZZ_SETTINGS localhost:8080 ./straight_stream_patterns +pathoc: sleep 2 && $PATHOC $FUZZ_SETTINGS localhost:8080 /tmp/err + |