[issue18167] cgi.FieldStorage fails to handle multipart/form-data when \r\n appears at end of 65535 bytes without other newlines

Chris AtLee report at bugs.python.org
Sat Jun 8 02:52:33 CEST 2013


Chris AtLee added the comment:

This is a possible fix to this issue. It's not as clean as I'd like, but the simpler versions I tried could end up with the entire file contents in memory for degenerate (or malicious) inputs.

The trick is handling the case where the current line ends with \r. We can't know if this is just a normal character in the file, or represents the end of a line until we see the start of the next line.

----------
Added file: http://bugs.python.org/file30503/cgi-cpython.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18167>
_______________________________________


More information about the Python-bugs-list mailing list