summaryrefslogtreecommitdiffstats
path: root/Lib/httplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r--Lib/httplib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py
index bb4b59e..5696467 100644
--- a/Lib/httplib.py
+++ b/Lib/httplib.py
@@ -438,6 +438,9 @@ class HTTPResponse:
self.length = int(length)
except ValueError:
self.length = None
+ else:
+ if self.length < 0: # ignore nonsensical negative lengths
+ self.length = None
else:
self.length = None