https://github.com/python/cpython/commit/6d6471b7eb099fefc243b2fba3825979fad7cf6f
commit: 6d6471b7eb099fefc243b2fba3825979fad7cf6f
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-05-04T14:06:00Z
summary:

[3.13] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE 
marshal stream (GH-148419) (GH-149364)

(cherry picked from commit c3972f2795bf9270008d09dc6919b9735e20c606)

Co-authored-by: Wulian233 <[email protected]>

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst
M Python/marshal.c

diff --git 
a/Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst
 
b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst
new file mode 100644
index 00000000000000..793858be7814c1
--- /dev/null
+++ 
b/Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst
@@ -0,0 +1 @@
+Fix a possible reference leak in a corrupted ``TYPE_CODE`` marshal stream.
diff --git a/Python/marshal.c b/Python/marshal.c
index c0eb5b4f3dd7fd..18b827b866c94f 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1487,7 +1487,7 @@ r_object(RFILE *p)
                 goto code_error;
             firstlineno = (int)r_long(p);
             if (firstlineno == -1 && PyErr_Occurred())
-                break;
+                goto code_error;
             linetable = r_object(p);
             if (linetable == NULL)
                 goto code_error;

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to