◐ Shell
clean mode source ↗

bpo-40412: Nullify inittab_copy during finalization by indygreg · Pull Request #19746 · python/cpython

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.

ericsnowcurrently

@blurb-it

brettcannon

@brettcannon

brettcannon

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 1, 2020
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 64224a4)

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

May 1, 2020
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 64224a4)

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>

miss-islington added a commit that referenced this pull request

May 1, 2020
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 64224a4)

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>