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
6790d606
Commit
6790d606
authored
Aug 30, 2007
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forbid an empty argument list in execv call.
Fixes issue 1039.
parent
8a7c866e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
Lib/test/test_os.py
Lib/test/test_os.py
+3
-0
Modules/posixmodule.c
Modules/posixmodule.c
+5
-0
No files found.
Lib/test/test_os.py
View file @
6790d606
...
...
@@ -441,6 +441,9 @@ class ExecTests(unittest.TestCase):
def
test_execvpe_with_bad_program
(
self
):
self
.
assertRaises
(
OSError
,
os
.
execvpe
,
'no such app-'
,
[],
None
)
def
test_execvpe_with_bad_arglist
(
self
):
self
.
assertRaises
(
ValueError
,
os
.
execvpe
,
'notepad'
,
[],
None
)
class
Win32ErrorTests
(
unittest
.
TestCase
):
def
test_rename
(
self
):
self
.
assertRaises
(
WindowsError
,
os
.
rename
,
test_support
.
TESTFN
,
test_support
.
TESTFN
+
".bak"
)
...
...
Modules/posixmodule.c
View file @
6790d606
...
...
@@ -2834,6 +2834,11 @@ posix_execv(PyObject *self, PyObject *args)
PyMem_Free
(
path
);
return
NULL
;
}
if
(
argc
<
1
)
{
PyErr_SetString
(
PyExc_ValueError
,
"execv() arg 2 must not be empty"
);
PyMem_Free
(
path
);
return
NULL
;
}
argvlist
=
PyMem_NEW
(
char
*
,
argc
+
1
);
if
(
argvlist
==
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