Skip to content

Commit

Permalink
[3.9] gh-119690: Fixes buffer type confusion in _winapi.CreateFile an…
Browse files Browse the repository at this point in the history
…d _winapi.CreateNamedPipe audit events (GH-119735) (#123679)

(cherry picked from commit 2e861ac)

Co-authored-by: Steve Dower <[email protected]>
  • Loading branch information
miss-islington and zooba authored Sep 4, 2024
1 parent d662e2d commit 9290419
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 9290419

Please sign in to comment.