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-Tag: v2.7.10rc1~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4cc93db9b3793688acf08ad78913b5a0228b5923;p=thirdparty%2FPython%2Fcpython.git avoid reading unallocated memory when argc == 0 (closes #22633) --- diff --git a/Python/frozenmain.c b/Python/frozenmain.c index d31da077085e..e742172494ee 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();