diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-02-14 20:17:25 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-02-14 20:17:25 (GMT) |
commit | 4cc93db9b3793688acf08ad78913b5a0228b5923 (patch) | |
tree | bee37b7a509ee7a24dda6bf057c2aad95d026c44 /Python | |
parent | 7fe04f1dca5820c43416145789f4cc2b94e918b8 (diff) | |
download | cpython-4cc93db9b3793688acf08ad78913b5a0228b5923.zip cpython-4cc93db9b3793688acf08ad78913b5a0228b5923.tar.gz cpython-4cc93db9b3793688acf08ad78913b5a0228b5923.tar.bz2 |
avoid reading unallocated memory when argc == 0 (closes #22633)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/frozenmain.c | 3 |
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(); |