Forbid an empty argument list in execv call.

Fixes issue 1039.
This commit is contained in:
Thomas Heller 2007-08-30 17:15:14 +00:00
parent 8a7c866e18
commit 6790d606ff
2 changed files with 8 additions and 0 deletions

View file

@ -2834,6 +2834,11 @@ posix_execv(PyObject *self, PyObject *args)
PyMem_Free(path);
return NULL;
}
if (argc < 1) {
PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty");
PyMem_Free(path);
return NULL;
}
argvlist = PyMem_NEW(char *, argc+1);
if (argvlist == NULL) {