[3.9] gh-119690: Fixes buffer type confusion in _winapi.CreateFile and _winapi.CreateNamedPipe audit events (GH-119735) (#123679)

(cherry picked from commit 2e861ac1cd4359463f6a13efd3d3578fce71e5ab)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2024-09-04 18:22:50 +02:00 committed by GitHub
parent d662e2db26
commit 9290419492
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1,2 @@
Fixes data type confusion in audit events raised by ``_winapi.CreateFile``
and ``_winapi.CreateNamedPipe``.

View File

@ -461,7 +461,7 @@ _winapi_CreateFile_impl(PyObject *module, LPCTSTR file_name,
{
HANDLE handle;
if (PySys_Audit("_winapi.CreateFile", "uIIII",
if (PySys_Audit("_winapi.CreateFile", "sIIII",
file_name, desired_access, share_mode,
creation_disposition, flags_and_attributes) < 0) {
return INVALID_HANDLE_VALUE;
@ -681,7 +681,7 @@ _winapi_CreateNamedPipe_impl(PyObject *module, LPCTSTR name, DWORD open_mode,
{
HANDLE handle;
if (PySys_Audit("_winapi.CreateNamedPipe", "uII",
if (PySys_Audit("_winapi.CreateNamedPipe", "sII",
name, open_mode, pipe_mode) < 0) {
return INVALID_HANDLE_VALUE;
}