https://github.com/python/cpython/commit/de27372234bf13aca763afd4414afff03ae1b70b
commit: de27372234bf13aca763afd4414afff03ae1b70b
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: Yhg1s <[email protected]>
date: 2025-02-04T00:37:24+01:00
summary:

[3.13] gh-129345: null check for indent syslogmodule (GH-129348) (#129442)

gh-129345: null check for indent syslogmodule (GH-129348)
(cherry picked from commit 25cf79a0829422bd8479ca0c13c72b769422077b)

Co-authored-by: Burkov Egor <[email protected]>

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-06-23-59.gh-issue-129345.uOjkML.rst
M 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
index 00000000000000..68e1103db45652
--- /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 adbd2fcc6ed74d..aa1bc9da91dfb9 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;
     }
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to