Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c8d6ab2e
Commit
c8d6ab2e
authored
Jun 23, 2017
by
Victor Stinner
Committed by
GitHub
Jun 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-30602: Fix lastarg in os.spawnve() (#2287)
Fix a regression introduced by myself in the commit
526b2265
.
parent
87c65550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Modules/posixmodule.c
Modules/posixmodule.c
+3
-3
No files found.
Modules/posixmodule.c
View file @
c8d6ab2e
...
@@ -5223,7 +5223,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
...
@@ -5223,7 +5223,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
Py_ssize_t
argc
,
i
,
envc
;
Py_ssize_t
argc
,
i
,
envc
;
intptr_t
spawnval
;
intptr_t
spawnval
;
PyObject
*
(
*
getitem
)(
PyObject
*
,
Py_ssize_t
);
PyObject
*
(
*
getitem
)(
PyObject
*
,
Py_ssize_t
);
Py_ssize_t
lastarg
=
-
1
;
Py_ssize_t
lastarg
=
0
;
/* spawnve has four arguments: (mode, path, argv, env), where
/* spawnve has four arguments: (mode, path, argv, env), where
argv is a list or tuple of strings and env is a dictionary
argv is a list or tuple of strings and env is a dictionary
...
@@ -5266,7 +5266,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
...
@@ -5266,7 +5266,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
goto
fail_1
;
goto
fail_1
;
}
}
if
(
i
==
0
&&
!
argvlist
[
0
][
0
])
{
if
(
i
==
0
&&
!
argvlist
[
0
][
0
])
{
lastarg
=
i
;
lastarg
=
i
+
1
;
PyErr_SetString
(
PyErr_SetString
(
PyExc_ValueError
,
PyExc_ValueError
,
"spawnv() arg 2 first element cannot be empty"
);
"spawnv() arg 2 first element cannot be empty"
);
...
@@ -5302,7 +5302,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
...
@@ -5302,7 +5302,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv,
PyMem_DEL
(
envlist
[
envc
]);
PyMem_DEL
(
envlist
[
envc
]);
PyMem_DEL
(
envlist
);
PyMem_DEL
(
envlist
);
fail_1:
fail_1:
free_string_array
(
argvlist
,
lastarg
+
1
);
free_string_array
(
argvlist
,
lastarg
);
fail_0:
fail_0:
return
res
;
return
res
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment