Index: posixmodule.c =================================================================== --- posixmodule.c (revision 88766) +++ posixmodule.c (working copy) @@ -3815,12 +3815,25 @@ Py_DECREF(opath); return NULL; } - + + if(!path || !*path) { + PyErr_SetString(PyExc_ValueError, + "spawnv() path can't be empty"); + Py_DECREF(opath); + return NULL; + } + if(!argc) { + PyErr_SetString(PyExc_ValueError, + "spawnv() arg 2 container must be not empty"); + Py_DECREF(opath); + return NULL; + } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { Py_DECREF(opath); return PyErr_NoMemory(); } + for (i = 0; i < argc; i++) { if (!fsconvert_strdup((*getitem)(argv, i), &argvlist[i])) { @@ -3832,6 +3845,12 @@ return NULL; } } + if(!*(argvlist[0])) { + PyErr_SetString(PyExc_ValueError, + "first argument can't be empty"); + Py_DECREF(opath); + return NULL; + } argvlist[argc] = NULL; #if defined(PYOS_OS2) && defined(PYCC_GCC)