]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 4 May 2026 14:07:43 +0000 (16:07 +0200)
committerGitHub <noreply@github.com>
Mon, 4 May 2026 14:07:43 +0000 (14:07 +0000)
(cherry picked from commit c3972f2795bf9270008d09dc6919b9735e20c606)

Co-authored-by: Wulian233 <1055917385@qq.com>
Misc/NEWS.d/next/Core_and_Builtins/2026-04-12-10-40-57.gh-issue-148418.ggA1LZ.rst [new file with mode: 0644]
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 (file)
index 0000000..793858b
--- /dev/null
@@ -0,0 +1 @@
+Fix a possible reference leak in a corrupted ``TYPE_CODE`` marshal stream.
index ade5c2e2fbcc70d3baa699fafbc94265c7d9ebfd..49de5662e7838070c39e7b898c4e8e72b8bf7d4a 100644 (file)
@@ -1608,7 +1608,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;