Skip to content

Commit

Permalink
[3.10] pythongh-119690: Fixes buffer type confusion in _winapi.Create…
Browse files Browse the repository at this point in the history
…File and _winapi.CreateNamedPipe audit events (pythonGH-119735)

(cherry picked from commit 2e861ac)

Co-authored-by: Steve Dower <[email protected]>
pythongh-119690: Fixes buffer type confusion in _winapi.CreateFile and _winapi.CreateNamedPipe audit events
  • Loading branch information
zooba authored and miss-islington committed Sep 4, 2024
1 parent d662e2d commit 050ee62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixes data type confusion in audit events raised by ``_winapi.CreateFile``
and ``_winapi.CreateNamedPipe``.
4 changes: 2 additions & 2 deletions Modules/_winapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 050ee62

Please sign in to comment.