diff options
-rwxr-xr-x | projects/aiohttp/build.sh | 7 | ||||
-rw-r--r-- | projects/aiohttp/fuzz_http_parser.py | 6 | ||||
-rw-r--r-- | projects/aiohttp/fuzz_http_payload_parser.py | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/projects/aiohttp/build.sh b/projects/aiohttp/build.sh index 17023bba..b75f0cdc 100755 --- a/projects/aiohttp/build.sh +++ b/projects/aiohttp/build.sh @@ -22,6 +22,13 @@ pip3 install -r requirements/dev.txt pre-commit install make install-dev +# Duplicate fuzzers to use Pure python code (in addition +# to the existing C-compiled code). +cp fuzz_http_parser.py fuzz_http_parser_pure_python.py +sed -i 's/AIOHTTP_VAL=0/AIOHTTP_VAL=1/g' fuzz_http_parser_pure_python.py +cp fuzz_http_payload_parser.py fuzz_http_payload_parser_pure_python.py +sed -i 's/AIOHTTP_VAL=0/AIOHTTP_VAL=1/g' fuzz_http_payload_parser_pure_python.py + # Build fuzzers in $OUT. for fuzzer in $(find $SRC -name 'fuzz_*.py'); do compile_python_fuzzer $fuzzer diff --git a/projects/aiohttp/fuzz_http_parser.py b/projects/aiohttp/fuzz_http_parser.py index 93c078ab..2d0a3057 100644 --- a/projects/aiohttp/fuzz_http_parser.py +++ b/projects/aiohttp/fuzz_http_parser.py @@ -13,6 +13,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +import os +AIOHTTP_VAL=0 +os.environ["AIOHTTP_NO_EXTENSIONS"] = str(AIOHTTP_VAL) + import sys import atheris @@ -30,6 +35,7 @@ def TestOneInput(data): h_p = aiohttp.http_parser.HttpRequestParser(pr, loop, 32768) try: h_p.feed_data(data) + h_p.feed_eof() except aiohttp.http_exceptions.HttpProcessingError: None diff --git a/projects/aiohttp/fuzz_http_payload_parser.py b/projects/aiohttp/fuzz_http_payload_parser.py index f48b2f77..2be93446 100644 --- a/projects/aiohttp/fuzz_http_payload_parser.py +++ b/projects/aiohttp/fuzz_http_payload_parser.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os +AIOHTTP_VAL=0 +os.environ["AIOHTTP_NO_EXTENSIONS"] = str(AIOHTTP_VAL) + import sys import atheris |