Issue #28732: Raise ValueError when argv[0] is empty.

This commit is contained in:
Steve Dower 2016-11-19 19:03:54 -08:00
parent 11f4326ca1
commit 93ff8725b3
1 changed files with 9 additions and 0 deletions

View File

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