From: Steve Dower Date: Sun, 20 Nov 2016 03:03:54 +0000 (-0800) Subject: Issue #28732: Raise ValueError when argv[0] is empty. X-Git-Tag: v3.6.0b4~50^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93ff8725b3f678586fbbc19d3d4b615b218300ff;p=python Issue #28732: Raise ValueError when argv[0] is empty. --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 6170ff7f79..3e446a524e 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5210,6 +5210,15 @@ os_spawnv_impl(PyObject *module, int mode, PyObject *path, PyObject *argv) "spawnv() arg 2 must contain only strings"); return NULL; } +#ifdef MS_WINDOWS + if (i == 0 && !argvlist[0][0]) { + free_string_array(argvlist, i); + PyErr_SetString( + PyExc_ValueError, + "spawnv() arg 2 first element cannot be empty"); + return NULL; + } +#endif } argvlist[argc] = NULL;