[Python-checkins] cpython (3.5): Issue #28732: Raise ValueError when argv[0] is empty.

steve.dower python-checkins at python.org
Sat Nov 19 22:17:57 EST 2016


https://hg.python.org/cpython/rev/e076ace7b0ff
changeset:   105196:e076ace7b0ff
branch:      3.5
parent:      105191:02f416441def
user:        Steve Dower <steve.dower at microsoft.com>
date:        Sat Nov 19 19:03:54 2016 -0800
summary:
  Issue #28732: Raise ValueError when argv[0] is empty.

files:
  Modules/posixmodule.c |  9 +++++++++
  1 files changed, 9 insertions(+), 0 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5210,6 +5210,15 @@
                 "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;
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list