SIGN IN SIGN UP

gh-97616: list_resize() checks for integer overflow (GH-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*)).
(cherry picked from commit a5f092f3c469b674b8d9ccbd4e4377230c9ac7cf)

Co-authored-by: Victor Stinner <vstinner@python.org>
M
Miss Islington (bot) committed
28f1435d94e72a1fadec2e3d94eac300bb386c2e
Parent: 3d8dfb3
Committed by GitHub <noreply@github.com> on 9/28/2022, 11:03:39 PM