]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-129345: null check for indent syslogmodule (#129348)
authorBurkov Egor <xwooffie@gmail.com>
Wed, 29 Jan 2025 13:49:23 +0000 (16:49 +0300)
committerGitHub <noreply@github.com>
Wed, 29 Jan 2025 13:49:23 +0000 (19:19 +0530)
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;
     }