From 046b92b7ebd914543b01552c7be7639613dd2a92 Mon Sep 17 00:00:00 2001 From: Kyle Marsh Date: Mon, 12 Sep 2011 12:35:10 -0700 Subject: [PATCH] S3 Fuzzer: httplib error handling Sometimes httplib will through a BadStatusLine error that the fuzzer should catch and register as a failure. --- s3tests/functional/test_fuzzer.py | 2 +- s3tests/fuzz_headers.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/s3tests/functional/test_fuzzer.py b/s3tests/functional/test_fuzzer.py index 1039b55..717b1db 100644 --- a/s3tests/functional/test_fuzzer.py +++ b/s3tests/functional/test_fuzzer.py @@ -1,4 +1,4 @@ -import sys +mport sys import itertools import nose import random diff --git a/s3tests/fuzz_headers.py b/s3tests/fuzz_headers.py index f5a20bc..e49713f 100644 --- a/s3tests/fuzz_headers.py +++ b/s3tests/fuzz_headers.py @@ -1,6 +1,7 @@ from boto.s3.connection import S3Connection from boto.exception import BotoServerError from boto.s3.key import Key +from httplib import BadStatusLine from optparse import OptionParser from . import common @@ -341,6 +342,10 @@ def _main(): response = e body = e.body failed = True + except BadStatusLine, e: + print>>OUT, 'FAILED: failed to parse response (BadStatusLine); probably a NUL byte in your request?' + print>>VERBOSE, '='*80 + continue if failed: print>>OUT, 'FAILED:'