Bug report
Bug description:
Parent: #146121
In r_object TYPE_CODE case (line 1601-1602), when firstlineno == -1 && PyErr_Occurred(), code does break instead of goto code_error. Skips cleanup of 8 owned refs. Reachable via marshal.loads() with crafted input.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-148418: Fix a possible reference leak in a corrupted
TYPE_CODEmarshal stream #148419 - [3.14] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream (GH-148419) #149363
- [3.13] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream (GH-148419) #149364