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
42e913aa
Commit
42e913aa
authored
Jul 02, 2015
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.4 (#24552)
parents
e31db2a8
80f78a3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
Lib/test/pickletester.py
Lib/test/pickletester.py
+12
-0
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_pickle.c
Modules/_pickle.c
+1
-1
No files found.
Lib/test/pickletester.py
View file @
42e913aa
...
...
@@ -1039,6 +1039,18 @@ class AbstractPickleTests(unittest.TestCase):
self
.
assertEqual
(
B
(
x
),
B
(
y
),
detail
)
self
.
assertEqual
(
x
.
__dict__
,
y
.
__dict__
,
detail
)
def
test_newobj_not_class
(
self
):
# Issue 24552
global
SimpleNewObj
save
=
SimpleNewObj
o
=
object
.
__new__
(
SimpleNewObj
)
b
=
self
.
dumps
(
o
,
4
)
try
:
SimpleNewObj
=
42
self
.
assertRaises
((
TypeError
,
pickle
.
UnpicklingError
),
self
.
loads
,
b
)
finally
:
SimpleNewObj
=
save
# Register a type with copyreg, with extension code extcode. Pickle
# an object of that type. Check that the resulting pickle uses opcode
# (EXT[124]) under proto 2, and not in proto 1.
...
...
Misc/NEWS
View file @
42e913aa
...
...
@@ -30,6 +30,8 @@ Core and Builtins
Library
-------
- Issue #24552: Fix use after free in an error case of the _pickle module.
- Issue #24514: tarfile now tolerates number fields consisting of only
whitespace.
...
...
Modules/_pickle.c
View file @
42e913aa
...
...
@@ -5279,10 +5279,10 @@ load_newobj_ex(UnpicklerObject *self)
if
(
!
PyType_Check
(
cls
))
{
Py_DECREF
(
kwargs
);
Py_DECREF
(
args
);
Py_DECREF
(
cls
);
PyErr_Format
(
st
->
UnpicklingError
,
"NEWOBJ_EX class argument must be a type, not %.200s"
,
Py_TYPE
(
cls
)
->
tp_name
);
Py_DECREF
(
cls
);
return
-
1
;
}
...
...
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