Closes #23801 - Ignore entire preamble to multipart in cgi.FieldStorage

This commit is contained in:
Donald Stufft 2015-03-29 16:43:23 -04:00
parent 1058cda38f
commit d90f8d10e0
3 changed files with 29 additions and 2 deletions

View file

@ -693,8 +693,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""