]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-129345: null check for indent syslogmodule (GH-129348) (#129442)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 3 Feb 2025 23:37:24 +0000 (00:37 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Feb 2025 23:37:24 +0000 (00:37 +0100)
gh-129345: null check for indent syslogmodule (GH-129348)
(cherry picked from commit 25cf79a0829422bd8479ca0c13c72b769422077b)

Co-authored-by: Burkov Egor <xwooffie@gmail.com>
Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-06-23-59.gh-issue-129345.uOjkML.rst [new file with mode: 0644]
Modules/syslogmodule.c

diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-06-23-59.gh-issue-129345.uOjkML.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-06-23-59.gh-issue-129345.uOjkML.rst
new file mode 100644 (file)
index 0000000..68e1103
--- /dev/null
@@ -0,0 +1 @@
+Fix null pointer dereference in :func:`syslog.openlog` when an audit hook raises an exception.
index adbd2fcc6ed74d715559804e1e666f297db322a3..aa1bc9da91dfb9caf14edbf304d868f33010b8a4 100644 (file)
@@ -176,7 +176,7 @@ syslog_openlog_impl(PyObject *module, PyObject *ident, long logopt,
         }
     }
     if (PySys_Audit("syslog.openlog", "Oll", ident ? ident : Py_None, logopt, facility) < 0) {
-        Py_DECREF(ident);
+        Py_XDECREF(ident);
         return NULL;
     }