classification
Title: Off by one error in cgi.FieldStorage(max_num_fields)
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Matthew Belisle, miss-islington
Priority: normal Keywords: patch

Created on 2018-10-19 18:36 by Matthew Belisle, last changed 2019-08-28 01:16 by benjamin.peterson. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9973 merged Matthew Belisle, 2018-10-19 18:37
PR 10053 merged miss-islington, 2018-10-23 08:14
PR 10054 merged miss-islington, 2018-10-23 08:14
Messages (4)
msg328060 - (view) Author: Matthew Belisle (Matthew Belisle) * Date: 2018-10-19 18:36
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.
msg328291 - (view) Author: miss-islington (miss-islington) Date: 2018-10-23 08:14
New changeset b79b5c09493e98374e48fa122d82dab528fc6e72 by Miss Islington (bot) (matthewbelisle-wf) in branch 'master':
bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973)
https://github.com/python/cpython/commit/b79b5c09493e98374e48fa122d82dab528fc6e72
msg328303 - (view) Author: miss-islington (miss-islington) Date: 2018-10-23 10:54
New changeset 58b614a327991f4baad4d2795a50027f75411450 by Miss Islington (bot) in branch '3.6':
bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973)
https://github.com/python/cpython/commit/58b614a327991f4baad4d2795a50027f75411450
msg328304 - (view) Author: miss-islington (miss-islington) Date: 2018-10-23 10:54
New changeset 178bf58e798d3ef63f18b314056efbc3c33dd48b by Miss Islington (bot) in branch '3.7':
bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973)
https://github.com/python/cpython/commit/178bf58e798d3ef63f18b314056efbc3c33dd48b
History
Date User Action Args
2019-08-28 01:16:38benjamin.petersonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-10-23 10:54:55miss-islingtonsetmessages: + msg328304
2018-10-23 10:54:47miss-islingtonsetmessages: + msg328303
2018-10-23 08:14:56miss-islingtonsetpull_requests: + pull_request9391
2018-10-23 08:14:47miss-islingtonsetpull_requests: + pull_request9390
2018-10-23 08:14:42miss-islingtonsetnosy: + miss-islington
messages: + msg328291
2018-10-19 18:37:44Matthew Belislesetkeywords: + patch
stage: patch review
pull_requests: + pull_request9317
2018-10-19 18:36:56Matthew Belislecreate