avoid reading unallocated memory when argc == 0 (closes #22633)

This commit is contained in:
Benjamin Peterson 2015-02-14 15:17:25 -05:00
parent 7fe04f1dca
commit 4cc93db9b3
1 changed files with 2 additions and 1 deletions

View File

@ -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();