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
db579d7b
Commit
db579d7b
authored
Aug 20, 2012
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15738: Fix a missing NULL check in subprocess_fork_exec().
parent
fd24f9e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/test/test_capi.py
Lib/test/test_capi.py
+10
-0
Modules/_posixsubprocess.c
Modules/_posixsubprocess.c
+2
-0
No files found.
Lib/test/test_capi.py
View file @
db579d7b
...
...
@@ -68,6 +68,16 @@ class CAPITest(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
_posixsubprocess
.
fork_exec
,
1
,
Z
(),
3
,[
1
,
2
],
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
)
@
unittest
.
skipUnless
(
_posixsubprocess
,
'_posixsubprocess required for this test.'
)
def
test_subprocess_fork_exec
(
self
):
class
Z
(
object
):
def
__len__
(
self
):
return
1
# Issue #15738: crash in subprocess_fork_exec()
self
.
assertRaises
(
TypeError
,
_posixsubprocess
.
fork_exec
,
Z
(),[
b'1'
],
3
,[
1
,
2
],
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
)
@
unittest
.
skipUnless
(
threading
,
'Threading required for this test.'
)
class
TestPendingCalls
(
unittest
.
TestCase
):
...
...
Modules/_posixsubprocess.c
View file @
db579d7b
...
...
@@ -577,6 +577,8 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
/* Equivalent to: */
/* tuple(PyUnicode_FSConverter(arg) for arg in process_args) */
fast_args
=
PySequence_Fast
(
process_args
,
"argv must be a tuple"
);
if
(
fast_args
==
NULL
)
goto
cleanup
;
num_args
=
PySequence_Fast_GET_SIZE
(
fast_args
);
converted_args
=
PyTuple_New
(
num_args
);
if
(
converted_args
==
NULL
)
...
...
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