commit | e9fbf2b943d79e8d8d71b64c1881829af880229d | [log] [tgz] |
---|---|---|
author | Matthias Klose <doko@ubuntu.com> | Fri Mar 19 14:45:06 2010 +0000 |
committer | Matthias Klose <doko@ubuntu.com> | Fri Mar 19 14:45:06 2010 +0000 |
tree | 91cadba294f38e27b6f7f0582da0f34eee7946b8 | |
parent | f4fd0bf7c1231e5613b706f044affb7f9f9b5366 [diff] [blame] |
- Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument.
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 @@ 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) {