diff options
author | Thomas Heller <theller@ctypes.org> | 2007-08-30 17:15:14 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2007-08-30 17:15:14 (GMT) |
commit | 6790d606ffb44b24129552fca5418c0d408aac05 (patch) | |
tree | 331d90466a778e38e21a1aa50efd603a76e4fbeb /Modules/posixmodule.c | |
parent | 8a7c866e18d12c9a666b556153555dc98c3f3f68 (diff) | |
download | cpython-6790d606ffb44b24129552fca5418c0d408aac05.zip cpython-6790d606ffb44b24129552fca5418c0d408aac05.tar.gz cpython-6790d606ffb44b24129552fca5418c0d408aac05.tar.bz2 |
Forbid an empty argument list in execv call.
Fixes issue 1039.
Diffstat (limited to 'Modules/posixmodule.c')
-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 4e6e0c5..5f8cde6 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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) { |