mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[3.14] gh-136053: Check error for TYPE_SLICE in marshal.c (GH-136054) (GH-136092)
Fix a possible crash when deserializing a large marshal data
(at least several GiBs) containing a slice.
(cherry picked from commit 30ba03ea8e
)
Co-authored-by: Akshat Gupta <akshat.gupta24@gmail.com>
This commit is contained in:
parent
7df3eee645
commit
ce65956177
2 changed files with 4 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
:mod:`marshal`: fix a possible crash when deserializing :class:`slice` objects.
|
|
@ -1656,6 +1656,9 @@ r_object(RFILE *p)
|
|||
case TYPE_SLICE:
|
||||
{
|
||||
Py_ssize_t idx = r_ref_reserve(flag, p);
|
||||
if (idx < 0) {
|
||||
break;
|
||||
}
|
||||
PyObject *stop = NULL;
|
||||
PyObject *step = NULL;
|
||||
PyObject *start = r_object(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue