Title: Unchecked return in Objects/typeobject.c and possible uninitialized variables in cls and new_mro
Type: enhancement Stage: patch review
Components: Library (Lib) Versions:
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: monocle-ai, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2020-10-14 13:47 by monocle-ai, last changed 2021-10-09 19:04 by serhiy.storchaka.

Pull Requests
URL Status Linked Edit
PR 22695 open python-dev, 2020-10-14 14:29
Messages (3)
msg378615 - (view) Author: Sagar Pant (monocle-ai) * Date: 2020-10-14 13:47
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 .
msg379784 - (view) Author: Sagar Pant (monocle-ai) * Date: 2020-10-27 17:37
Bumping this up for updates.
msg403547 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-09 19:04
There is no bug in this code. The list "temp" contains only 2- and 3-tuples. PyArg_UnpackTuple() never fails.
Date User Action Args
2021-10-09 19:04:14serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg403547
2020-10-27 17:37:23monocle-aisetmessages: + msg379784
2020-10-14 21:42:21monocle-aisetcomponents: + Library (Lib), - C API
2020-10-14 14:29:21python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request21666
stage: patch review
2020-10-14 13:47:28monocle-aicreate