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: PySequence_Check: argument is dereferenced and then checked for NULL
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, berker.peksag, izbyshev, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

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

Pull Requests
URL Status Linked Edit
PR 8935 merged izbyshev, 2018-08-25 21:07
PR 8936 merged miss-islington, 2018-08-25 23:52
PR 8937 merged miss-islington, 2018-08-25 23:52
Messages (4)
msg324101 - (view) Author: Alexey Izbyshev (izbyshev) * (Python triager) Date: 2018-08-25 21:05
The argument of PySequence_Check() is dereferenced at https://github.com/python/cpython/blob/5f79b50763d687aeeed8edcb4efcc7ac9f8fa186/Objects/abstract.c#L1511 and then checked for NULL.

Reported by Svace static analyzer.

Since other PySomething_Check() functions seem to expect a non-NULL argument, I suggest to remove the NULL check instead of moving it.
msg324107 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-08-25 23:52
New changeset b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9 by Benjamin Peterson (Alexey Izbyshev) in branch 'master':
closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)
https://github.com/python/cpython/commit/b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9
msg324108 - (view) Author: miss-islington (miss-islington) Date: 2018-08-26 00:03
New changeset d6725fcdd54cb3c72201eaa8841dd72d84f5f71d by Miss Islington (bot) in branch '3.7':
closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)
https://github.com/python/cpython/commit/d6725fcdd54cb3c72201eaa8841dd72d84f5f71d
msg324109 - (view) Author: miss-islington (miss-islington) Date: 2018-08-26 00:14
New changeset d60bdf239e322316c8b5e37679cb8e789028aae2 by Miss Islington (bot) in branch '3.6':
closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)
https://github.com/python/cpython/commit/d60bdf239e322316c8b5e37679cb8e789028aae2
History
Date User Action Args
2022-04-11 14:59:05adminsetgithub: 78685
2018-08-26 00:14:40miss-islingtonsetmessages: + msg324109
2018-08-26 00:03:52miss-islingtonsetnosy: + miss-islington
messages: + msg324108
2018-08-25 23:52:54miss-islingtonsetpull_requests: + pull_request8409
2018-08-25 23:52:46miss-islingtonsetpull_requests: + pull_request8408
2018-08-25 23:52:30benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg324107

stage: patch review -> resolved
2018-08-25 21:07:36izbyshevsetkeywords: + patch
stage: patch review
pull_requests: + pull_request8407
2018-08-25 21:05:49izbyshevcreate