summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/C API
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-08-23 10:04:16 (GMT)
committerGitHub <noreply@github.com>2019-08-23 10:04:16 (GMT)
commitc48682509dc49b43fe914fe6c502bc390345d1c2 (patch)
tree2558ec6d9de1ec6575d03bdd41843b108d59278a /Misc/NEWS.d/next/C API
parentd288b29fc652d27191bde3b3c9145c2eb8169929 (diff)
downloadcpython-c48682509dc49b43fe914fe6c502bc390345d1c2.zip
cpython-c48682509dc49b43fe914fe6c502bc390345d1c2.tar.gz
cpython-c48682509dc49b43fe914fe6c502bc390345d1c2.tar.bz2
bpo-37926: Fix PySys_SetArgvEx(0, NULL, 0) crash (GH-15415)
empty_argv is no longer static in Python 3.8, but it is declared in a temporary scope, whereas argv keeps a reference to it. empty_argv memory (allocated on the stack) is reused by make_sys_argv() code which is inlined when using gcc -O3. Define empty_argv in PySys_SetArgvEx() body, to ensure that it remains valid for the whole lifetime of the PySys_SetArgvEx() call.
Diffstat (limited to 'Misc/NEWS.d/next/C API')
-rw-r--r--Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst b/Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst
new file mode 100644
index 0000000..2018533
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2019-08-23-11-35-55.bpo-37926.hnI5IQ.rst
@@ -0,0 +1 @@
+Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``.