summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-08-30 17:15:14 +0000
committerThomas Heller <theller@ctypes.org>2007-08-30 17:15:14 +0000
commit0543f8afe3e2de0f24a96c5e4afd7bad7dd13d2a (patch)
treecfe65c4439b6e54b489a0f1812d8853a83633ffe /Modules
parent559173ddd751ec605a22083932b6f4ed90705c68 (diff)
downloadcpython-0543f8afe3e2de0f24a96c5e4afd7bad7dd13d2a.tar.gz
Forbid an empty argument list in execv call.
Fixes issue 1039.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 4e6e0c595d..5f8cde6010 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) {