]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40412: Nullify inittab_copy during finalization (GH-19746)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 1 May 2020 23:06:23 +0000 (16:06 -0700)
committerGitHub <noreply@github.com>
Fri, 1 May 2020 23:06:23 +0000 (16:06 -0700)
commit1205afb3e10194fe22fa76385abb7e522144eb29
tree1f08b7636d20424caf0c02ad0b5a97da00af8625
parente05828055e5165cc7268ea3bea33adc502e054a1
bpo-40412: Nullify inittab_copy during finalization (GH-19746)

Otherwise we leave a dangling pointer to free'd memory. If we
then initialize a new interpreter in the same process and call
PyImport_ExtendInittab, we will (likely) crash when calling
PyMem_RawRealloc(inittab_copy, ...) since the pointer address
is bogus.

Automerge-Triggered-By: @brettcannon
(cherry picked from commit 64224a4727321a8dd33e6f769edda401193ebef0)

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
Misc/NEWS.d/next/C API/2020-05-01-17-28-04.bpo-40412.dE0D8N.rst [new file with mode: 0644]
Python/import.c