From: Benjamin Peterson Date: Sat, 14 Feb 2015 20:17:25 +0000 (-0500) Subject: avoid reading unallocated memory when argc == 0 (closes #22633) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cc93db9b3793688acf08ad78913b5a0228b5923;p=python avoid reading unallocated memory when argc == 0 (closes #22633) --- diff --git a/Python/frozenmain.c b/Python/frozenmain.c index d31da07708..e742172494 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();