diff options
| author | Benjamin Peterson <benjamin@python.org> | 2015-03-29 16:45:19 -0400 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2015-03-29 16:45:19 -0400 |
| commit | 0deefd5a9402e3bd13ed899f9b939062faf98114 (patch) | |
| tree | 7fda9ee820a42082dc399dcb8e2b9033323d6291 /Lib/cgi.py | |
| parent | f375b0a4d5a0362ca9b927e626a00c8328f3ac04 (diff) | |
| parent | d90f8d10e088657593fa753ecacab95845d378aa (diff) | |
| download | cpython-git-0deefd5a9402e3bd13ed899f9b939062faf98114.tar.gz | |
merge 3.4 (#23801)
Diffstat (limited to 'Lib/cgi.py')
| -rwxr-xr-x | Lib/cgi.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py index a55232eb62..4be28ba0dc 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -699,8 +699,13 @@ class FieldStorage: raise ValueError("%s should return bytes, got %s" \ % (self.fp, type(first_line).__name__)) self.bytes_read += len(first_line) - # first line holds boundary ; ignore it, or check that - # b"--" + ib == first_line.strip() ? + + # Ensure that we consume the file until we've hit our inner boundary + while (first_line.strip() != (b"--" + self.innerboundary) and + first_line): + first_line = self.fp.readline() + self.bytes_read += len(first_line) + while True: parser = FeedParser() hdr_text = b"" |
