Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off by one error in cgi.FieldStorage(max_num_fields) #79209

Closed
matthewbelisle-wf mannequin opened this issue Oct 19, 2018 · 4 comments
Closed

Off by one error in cgi.FieldStorage(max_num_fields) #79209

matthewbelisle-wf mannequin opened this issue Oct 19, 2018 · 4 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@matthewbelisle-wf
Copy link
Mannequin

matthewbelisle-wf mannequin commented Oct 19, 2018

BPO 35028
Nosy @miss-islington, @matthewbelisle-wf
PRs
  • bpo-35028: cgi: Fix max_num_fields off by one error #9973
  • [3.7] bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) #10053
  • [3.6] bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973) #10054
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-08-28.01:16:38.120>
    created_at = <Date 2018-10-19.18:36:56.897>
    labels = ['3.7', '3.8', 'type-bug', 'library']
    title = 'Off by one error in cgi.FieldStorage(max_num_fields)'
    updated_at = <Date 2019-08-28.01:16:38.120>
    user = 'https://github.com/matthewbelisle-wf'

    bugs.python.org fields:

    activity = <Date 2019-08-28.01:16:38.120>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-08-28.01:16:38.120>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2018-10-19.18:36:56.897>
    creator = 'Matthew Belisle'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35028
    keywords = ['patch']
    message_count = 4.0
    messages = ['328060', '328291', '328303', '328304']
    nosy_count = 2.0
    nosy_names = ['miss-islington', 'Matthew Belisle']
    pr_nums = ['9973', '10053', '10054']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35028'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @matthewbelisle-wf
    Copy link
    Mannequin Author

    matthewbelisle-wf mannequin commented Oct 19, 2018

    The cgi.FieldStorage class added in #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 #9969.

    @matthewbelisle-wf matthewbelisle-wf mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 19, 2018
    @miss-islington
    Copy link
    Contributor

    New changeset b79b5c0 by Miss Islington (bot) (matthewbelisle-wf) in branch 'master':
    bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973)
    b79b5c0

    @miss-islington
    Copy link
    Contributor

    New changeset 58b614a by Miss Islington (bot) in branch '3.6':
    bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973)
    58b614a

    @miss-islington
    Copy link
    Contributor

    New changeset 178bf58 by Miss Islington (bot) in branch '3.7':
    bpo-35028: cgi: Fix max_num_fields off by one error (GH-9973)
    178bf58

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants