]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-106168: PyTuple_SET_ITEM() now checks the index (#106164)
authorVictor Stinner <vstinner@python.org>
Wed, 28 Jun 2023 01:45:57 +0000 (03:45 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2023 01:45:57 +0000 (03:45 +0200)
commit3f8483cad2f3b94600c3ecf3f0bb220bb1e61d7d
treed2a68be122484d443ab9260b2b542a9c509defe1
parent161012fc25910a47423bae8012398bf519a88140
gh-106168: PyTuple_SET_ITEM() now checks the index (#106164)

PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument
with an assertion if Python is built in debug mode or is built with
assertions.

* list_extend() and _PyList_AppendTakeRef() now set the list size
  before calling PyList_SET_ITEM().
* PyStructSequence_GetItem() and PyStructSequence_SetItem() now check
  the index argument: must be lesser than REAL_SIZE(op).
* PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now
  aliases to PyStructSequence_GetItem() and
  PyStructSequence_SetItem().
Doc/c-api/list.rst
Doc/c-api/tuple.rst
Doc/whatsnew/3.13.rst
Include/cpython/listobject.h
Include/cpython/tupleobject.h
Include/internal/pycore_list.h
Include/structseq.h
Misc/NEWS.d/next/C API/2023-06-28-02-30-50.gh-issue-106168.NFOZPv.rst [new file with mode: 0644]
Objects/listobject.c
Objects/structseq.c