From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 4 May 2026 14:07:43 +0000 (+0200) Subject: [3.14] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal... X-Git-Tag: v3.14.5rc1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95979d18138a2afe2e9dd9917bf59148116be394;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-148418: Fix a possible reference leak in a corrupted TYPE_CODE marshal stream (GH-148419) (GH-149363) (cherry picked from commit c3972f2795bf9270008d09dc6919b9735e20c606) Co-authored-by: Wulian233 <1055917385@qq.com> --- 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 000000000000..793858be7814 --- /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 ade5c2e2fbcc..49de5662e783 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -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;