Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(32096)

Unified Diff: Lib/httplib.py

Issue 16037: httplib: header parsing is not delimited
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/test/test_httplib.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/httplib.py Fri Aug 01 23:51:51 2014 -0700
+++ b/Lib/httplib.py Sat Aug 02 13:59:25 2014 +0000
@@ -214,6 +214,7 @@
# maximal line length when calling readline().
_MAXLINE = 65536
+_MAXHEADERS = 100
class HTTPMessage(mimetools.Message):
@@ -271,6 +272,8 @@
elif self.seekable:
tell = self.fp.tell
while True:
+ if len(hlist) > _MAXHEADERS:
+ raise HTTPException("got more than %d headers" % _MAXHEADERS)
if tell:
try:
startofline = tell()
« no previous file with comments | « no previous file | Lib/test/test_httplib.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+