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
d958cc96
Commit
d958cc96
authored
Jun 29, 2012
by
Amaury Forgeot d'Arc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15219: Fix a reference leak when hashlib.new() is called with
invalid parameters.
parent
45f0d983
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Lib/test/test_hashlib.py
Lib/test/test_hashlib.py
+2
-6
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_hashopenssl.c
Modules/_hashopenssl.c
+1
-0
No files found.
Lib/test/test_hashlib.py
View file @
d958cc96
...
...
@@ -108,12 +108,8 @@ class HashLibTestCase(unittest.TestCase):
_algo
.
islower
()]))
def
test_unknown_hash
(
self
):
try
:
hashlib
.
new
(
'spam spam spam spam spam'
)
except
ValueError
:
pass
else
:
self
.
assertTrue
(
0
==
"hashlib didn't reject bogus hash name"
)
self
.
assertRaises
(
ValueError
,
hashlib
.
new
,
'spam spam spam spam spam'
)
self
.
assertRaises
(
TypeError
,
hashlib
.
new
,
1
)
def
test_get_builtin_constructor
(
self
):
get_builtin_constructor
=
hashlib
.
__dict__
[
...
...
Misc/NEWS
View file @
d958cc96
...
...
@@ -75,6 +75,9 @@ Core and Builtins
Library
-------
- Issue #15219: Fix a reference leak when hashlib.new() is called with
invalid parameters.
- Issue #9559: If messages were only added, a new file is no longer
created and renamed over the old file when flush() is called on an
mbox, MMDF or Babyl mailbox.
...
...
Modules/_hashopenssl.c
View file @
d958cc96
...
...
@@ -477,6 +477,7 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
}
if
(
!
PyArg_Parse
(
name_obj
,
"s"
,
&
name
))
{
PyBuffer_Release
(
&
view
);
PyErr_SetString
(
PyExc_TypeError
,
"name must be a string"
);
return
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