You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several issues with corner cases in syslog.openlog().
syslog_get_argv() swallows exceptions, but not in all cases.
if ident is non UTF-8 encodable, syslog.openlog() fails after setting the global reference to ident. Now the C string saved internally in the previous call to openlog() points to the freed memory.
PySys_Audit() can crash if ident is NULL.
There may be a race condition with syslog.syslog(), because the global reference to ident is decrefed before setting the new value.
And, since syslog.syslog() releases the GIL, there may be a race condition syslog.syslog() with syslog.openlog() and syslog.closelog() which can decref the global reference to ident.
P.S. @noamcohen97 noticed yet one issue in syslog.syslog() (potential returning a value from a function while an exception is set #95012 (comment)) and fixed it.
Activity
pythongh-95041: Fix several minor issues in syslog.openlog()
serhiy-storchaka commentedon Jul 25, 2022
arhadthedev commentedon Jul 25, 2022
pythongh-95041: Fix several minor issues in syslog.openlog() (pythonG…
gh-95041: Fix several minor issues in syslog.openlog() (GH-95058)
pythongh-95041: Fix several minor issues in syslog.openlog() (pythonG…
gh-95041: Fix several minor issues in syslog.openlog() (GH-95058)
gh-95041: Fix several minor issues in syslog.openlog() (GH-95058) (GH…
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fai…
pythongh-95041: Fail syslog.syslog in case inner call to syslog.openl…
pythongh-95041: Fail syslog.syslog in case inner call to syslog.openl…
erlend-aasland commentedon Jul 26, 2022
I'm keeping this open until you decide about the NEWS entry, Serhiy. I'll mark it pending close, though.
erlend-aasland commentedon Jul 26, 2022
Fixed by:
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fai…
gh-95041: Fail syslog.syslog in case inner call to syslog.openlog fai…
erlend-aasland commentedon Jul 27, 2022
(Ooops, sorry; pressed the wrong button)
hauntsaninja commentedon Oct 12, 2022
We kept this open based on #95264 (comment)
It looks like Serhiy added the tests in #97953 but chose not to add a changelog entry, so I think we can close this out.