Skip to content

Unchecked return in Objects/typeobject.c and possible uninitialized variables in cls and new_mro #86200

Closed as not planned

Description

@monocle-ai
BPO 42034
Nosy @serhiy-storchaka
PRs
  • bpo-42034:Fixed unchecked return in Objects/typeobject.c #22695
  • 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 = None
    created_at = <Date 2020-10-14.13:47:28.507>
    labels = ['type-feature', 'library']
    title = 'Unchecked return in Objects/typeobject.c and possible uninitialized variables in cls and new_mro'
    updated_at = <Date 2021-10-09.19:04:14.462>
    user = 'https://bugs.python.org/monocle-ai'

    bugs.python.org fields:

    activity = <Date 2021-10-09.19:04:14.462>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2020-10-14.13:47:28.507>
    creator = 'monocle-ai'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42034
    keywords = ['patch']
    message_count = 3.0
    messages = ['378615', '379784', '403547']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'serhiy.storchaka', 'monocle-ai']
    pr_nums = ['22695']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42034'
    versions = []

    Activity

    1. monocle-ai commented on Oct 14, 2020

      monocle-aimannequin
      MannequinAuthor

      The return value of a function that is potentially used to initialize a local variable is not checked. Therefore, reading the local variable may result in undefined behavior.

      Our AI analyzer found that this function is called for a total of 43 times. Out of these 43 times, the return value from the function call is checked at 42 instances. This is the only instance where the code misses to check the return value for success or failure.

      Once such correct reference usage found in Python/hamt.c at line 2805 .

    2. added
      type-featureA feature request or enhancement
      stdlibStandard Library Python modules in the Lib/ directory
      and removed on Oct 14, 2020
    3. monocle-ai commented on Oct 27, 2020

      monocle-aimannequin
      MannequinAuthor

      Bumping this up for updates.

    4. serhiy-storchaka commented on Oct 9, 2021

      @serhiy-storchaka
      Member

      There is no bug in this code. The list "temp" contains only 2- and 3-tuples. PyArg_UnpackTuple() never fails.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions