]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-97616: list_resize() checks for integer overflow (#97617)
authorVictor Stinner <vstinner@python.org>
Wed, 28 Sep 2022 22:07:07 +0000 (00:07 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Sep 2022 22:07:07 +0000 (00:07 +0200)
commita5f092f3c469b674b8d9ccbd4e4377230c9ac7cf
tree95ce34b8dfa9f92bde8e75260a135e379721d676
parent81b9d9ddc20837ecd19f41b764e3f33d8ae805d5
gh-97616: list_resize() checks for integer overflow (#97617)

Fix multiplying a list by an integer (list *= int): detect the
integer overflow when the new allocated length is close to the
maximum size.  Issue reported by Jordan Limor.

list_resize() now checks for integer overflow before multiplying the
new allocated length by the list item size (sizeof(PyObject*)).
Lib/test/test_list.py
Misc/NEWS.d/next/Security/2022-09-28-17-09-37.gh-issue-97616.K1e3Xs.rst [new file with mode: 0644]
Objects/listobject.c