- 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) {