diff options
author | Matthias Klose <doko@ubuntu.com> | 2010-03-19 14:45:06 (GMT) |
---|---|---|
committer | Matthias Klose <doko@ubuntu.com> | 2010-03-19 14:45:06 (GMT) |
commit | e9fbf2b943d79e8d8d71b64c1881829af880229d (patch) | |
tree | 91cadba294f38e27b6f7f0582da0f34eee7946b8 /Modules | |
parent | f4fd0bf7c1231e5613b706f044affb7f9f9b5366 (diff) | |
download | cpython-e9fbf2b943d79e8d8d71b64c1881829af880229d.zip cpython-e9fbf2b943d79e8d8d71b64c1881829af880229d.tar.gz cpython-e9fbf2b943d79e8d8d71b64c1881829af880229d.tar.bz2 |
- Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f729e88..8fb7aaa 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2952,6 +2952,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) { |