This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Objects/typeobject.c: Missing NULL check in type_init()
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, berker.peksag, izbyshev, miss-islington, pitrou, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-08-23 14:52 by izbyshev, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8876 merged izbyshev, 2018-08-23 14:55
PR 8886 merged miss-islington, 2018-08-24 04:22
PR 8887 merged miss-islington, 2018-08-24 04:22
PR 8888 merged miss-islington, 2018-08-24 04:22
Messages (5)
msg323951 - (view) Author: Alexey Izbyshev (izbyshev) * (Python triager) Date: 2018-08-23 14:52
The return value of PyTuple_GetSlice() at https://github.com/python/cpython/blob/48ce4897f8f8d91d948ecd1241ffab002df2be9e/Objects/typeobject.c#L2297 is not checked for NULL and then dereferenced.

Reported by Svace static analyzer.

Currently, PyTuple_GetSlice() for a zero-length slice can fail only if it's the first zero-length tuple ever created. If there is an invariant that at least one zero-length tuple exists on any type_init() call, the check may be replaced with an assert.
msg323983 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-08-24 04:22
New changeset f6247aac08c1a79d0479145a405718bb76dba434 by Benjamin Peterson (Alexey Izbyshev) in branch 'master':
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
https://github.com/python/cpython/commit/f6247aac08c1a79d0479145a405718bb76dba434
msg323985 - (view) Author: miss-islington (miss-islington) Date: 2018-08-24 04:38
New changeset 609062a23f018f4ffc180a88435d61f871165518 by Miss Islington (bot) in branch '3.7':
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
https://github.com/python/cpython/commit/609062a23f018f4ffc180a88435d61f871165518
msg323987 - (view) Author: miss-islington (miss-islington) Date: 2018-08-24 04:49
New changeset fbe359a5e0b22e96065d24d033bebf27cdb374be by Miss Islington (bot) in branch '3.6':
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
https://github.com/python/cpython/commit/fbe359a5e0b22e96065d24d033bebf27cdb374be
msg323988 - (view) Author: miss-islington (miss-islington) Date: 2018-08-24 04:51
New changeset ea21206626d0907e0ecfd3efbb186f14f1a8a5d4 by Miss Islington (bot) in branch '2.7':
closes bpo-34477: Objects/typeobject.c: Add missing NULL check to type_init() (GH-8876)
https://github.com/python/cpython/commit/ea21206626d0907e0ecfd3efbb186f14f1a8a5d4
History
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78658
2018-08-24 04:51:49miss-islingtonsetmessages: + msg323988
2018-08-24 04:49:33miss-islingtonsetmessages: + msg323987
2018-08-24 04:38:19miss-islingtonsetnosy: + miss-islington
messages: + msg323985
2018-08-24 04:22:44miss-islingtonsetpull_requests: + pull_request8361
2018-08-24 04:22:35miss-islingtonsetpull_requests: + pull_request8360
2018-08-24 04:22:29miss-islingtonsetpull_requests: + pull_request8359
2018-08-24 04:22:19benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg323983

resolution: fixed
stage: patch review -> resolved
2018-08-23 14:55:45izbyshevsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8351
2018-08-23 14:52:19izbyshevcreate