[issue35028] Off by one error in cgi.FieldStorage(max_num_fields)

Matthew Belisle report at bugs.python.org
Fri Oct 19 14:36:56 EDT 2018


New submission from Matthew Belisle <matthew.belisle at workiva.com>:

The cgi.FieldStorage class added in https://github.com/python/cpython/pull/9660 has an off by one error in the logic for recursively nested objects. The problem is that sub_max_num_fields should be initialized outside of the while loop, not inside of it. Adding a unit test to cover this case.

Note: This problem does not exist in the 2.7 backport in https://github.com/python/cpython/pull/9969.

----------
components: Library (Lib)
messages: 328060
nosy: Matthew Belisle
priority: normal
severity: normal
status: open
title: Off by one error in cgi.FieldStorage(max_num_fields)
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35028>
_______________________________________


More information about the Python-bugs-list mailing list