From: Burkov Egor Date: Wed, 29 Jan 2025 13:49:23 +0000 (+0300) Subject: gh-129345: null check for indent syslogmodule (#129348) X-Git-Tag: v3.14.0a5~191 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25cf79a0829422bd8479ca0c13c72b769422077b;p=thirdparty%2FPython%2Fcpython.git gh-129345: null check for indent syslogmodule (#129348) --- 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 index 000000000000..68e1103db456 --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-06-23-59.gh-issue-129345.uOjkML.rst @@ -0,0 +1 @@ +Fix null pointer dereference in :func:`syslog.openlog` when an audit hook raises an exception. diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index adbd2fcc6ed7..aa1bc9da91df 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -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; }