mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-30730: Prevent environment variables injection in subprocess on Windows. (#2325)
Prevent passing other invalid environment variables and command arguments.
This commit is contained in:
parent
d352d68977
commit
d174d24a5d
5 changed files with 72 additions and 9 deletions
|
@ -2558,8 +2558,8 @@ _PySequence_BytesToCharpArray(PyObject* self)
|
|||
array[i] = NULL;
|
||||
goto fail;
|
||||
}
|
||||
data = PyBytes_AsString(item);
|
||||
if (data == NULL) {
|
||||
/* check for embedded null bytes */
|
||||
if (PyBytes_AsStringAndSize(item, &data, NULL) < 0) {
|
||||
/* NULL terminate before freeing. */
|
||||
array[i] = NULL;
|
||||
goto fail;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue