mirror of
https://github.com/python/cpython.git
synced 2026-05-09 03:50:56 +00:00
gh-148653: Fix SIGSEGV in marshal.loads for self-referencing tuples
This commit is contained in:
parent
2faceeec5c
commit
7c214ea52e
3 changed files with 26 additions and 1 deletions
|
|
@ -1385,7 +1385,9 @@ r_object(RFILE *p)
|
|||
}
|
||||
_read_tuple:
|
||||
v = PyTuple_New(n);
|
||||
R_REF(v);
|
||||
idx = r_ref_reserve(flag, p);
|
||||
if (idx < 0)
|
||||
Py_CLEAR(v);
|
||||
if (v == NULL)
|
||||
break;
|
||||
|
||||
|
|
@ -1400,6 +1402,7 @@ r_object(RFILE *p)
|
|||
}
|
||||
PyTuple_SET_ITEM(v, i, v2);
|
||||
}
|
||||
v = r_ref_insert(v, idx, flag, p);
|
||||
retval = v;
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue