summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-11-20 03:03:54 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-11-20 03:03:54 (GMT)
commit93ff8725b3f678586fbbc19d3d4b615b218300ff (patch)
tree41c7a495610c8f9f5f95216202dc3d876de58b95
parent11f4326ca146ac744ebdfc23149fe3fb9a89e812 (diff)
downloadcpython-93ff8725b3f678586fbbc19d3d4b615b218300ff.zip
cpython-93ff8725b3f678586fbbc19d3d4b615b218300ff.tar.gz
cpython-93ff8725b3f678586fbbc19d3d4b615b218300ff.tar.bz2
Issue #28732: Raise ValueError when argv[0] is empty.
-rw-r--r--Modules/posixmodule.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 6170ff7..3e446a5 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5210,6 +5210,15 @@ os_spawnv_impl(PyObject *module, int mode, PyObject *path, PyObject *argv)
"spawnv() arg 2 must contain only strings");
return NULL;
}
+#ifdef MS_WINDOWS
+ if (i == 0 && !argvlist[0][0]) {
+ free_string_array(argvlist, i);
+ PyErr_SetString(
+ PyExc_ValueError,
+ "spawnv() arg 2 first element cannot be empty");
+ return NULL;
+ }
+#endif
}
argvlist[argc] = NULL;