commit | 6790d606ffb44b24129552fca5418c0d408aac05 | [log] [tgz] |
---|---|---|
author | Thomas Heller <theller@ctypes.org> | Thu Aug 30 17:15:14 2007 +0000 |
committer | Thomas Heller <theller@ctypes.org> | Thu Aug 30 17:15:14 2007 +0000 |
tree | 331d90466a778e38e21a1aa50efd603a76e4fbeb | |
parent | 8a7c866e18d12c9a666b556153555dc98c3f3f68 [diff] [blame] |
Forbid an empty argument list in execv call. Fixes issue 1039.
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 @@ 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) {