mirror of
https://github.com/python/cpython.git
synced 2025-10-19 16:03:42 +00:00
gh-136053: Check error for TYPE_SLICE in marshal.c (GH-136054)
Fix a possible crash when deserializing a large marshal data (at least several GiBs) containing a slice.
This commit is contained in:
parent
f04d2b8819
commit
30ba03ea8e
2 changed files with 4 additions and 0 deletions
|
@ -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