From ed64b0e79699681bd5db3ff2823c47a424fbc3e1 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 22 Jul 2012 12:35:16 +1200 Subject: [PATCH] Fix http_protocol parsing crash discovered with pathoc fuzzing. --- netlib/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netlib/http.py b/netlib/http.py index 88e66ce46..9d6db0036 100644 --- a/netlib/http.py +++ b/netlib/http.py @@ -141,10 +141,10 @@ def parse_http_protocol(s): """ if not s.startswith("HTTP/"): return None - _, version = s.split('/') + _, version = s.split('/', 1) if "." not in version: return None - major, minor = version.split('.') + major, minor = version.split('.', 1) try: major = int(major) minor = int(minor)