summaryrefslogtreecommitdiffstats
path: root/Python/frozenmain.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-02-14 20:17:25 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-02-14 20:17:25 (GMT)
commit4cc93db9b3793688acf08ad78913b5a0228b5923 (patch)
treebee37b7a509ee7a24dda6bf057c2aad95d026c44 /Python/frozenmain.c
parent7fe04f1dca5820c43416145789f4cc2b94e918b8 (diff)
downloadcpython-4cc93db9b3793688acf08ad78913b5a0228b5923.zip
cpython-4cc93db9b3793688acf08ad78913b5a0228b5923.tar.gz
cpython-4cc93db9b3793688acf08ad78913b5a0228b5923.tar.bz2
avoid reading unallocated memory when argc == 0 (closes #22633)
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r--Python/frozenmain.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index d31da07..e742172 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -35,7 +35,8 @@ Py_FrozenMain(int argc, char **argv)
#ifdef MS_WINDOWS
PyInitFrozenExtensions();
#endif /* MS_WINDOWS */
- Py_SetProgramName(argv[0]);
+ if (argc >= 1)
+ Py_SetProgramName(argv[0]);
Py_Initialize();
#ifdef MS_WINDOWS
PyWinFreeze_ExeInit();