]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] gh-119690: Fixes buffer type confusion in _winapi.CreateFile and _winapi.Create...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 4 Sep 2024 16:22:50 +0000 (18:22 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Sep 2024 16:22:50 +0000 (18:22 +0200)
(cherry picked from commit 2e861ac1cd4359463f6a13efd3d3578fce71e5ab)

Co-authored-by: Steve Dower <steve.dower@python.org>
Misc/NEWS.d/next/Windows/2024-05-29-17-05-28.gh-issue-119690.U6RMtm.rst [new file with mode: 0644]
Modules/_winapi.c

diff --git a/Misc/NEWS.d/next/Windows/2024-05-29-17-05-28.gh-issue-119690.U6RMtm.rst b/Misc/NEWS.d/next/Windows/2024-05-29-17-05-28.gh-issue-119690.U6RMtm.rst
new file mode 100644 (file)
index 0000000..4488979
--- /dev/null
@@ -0,0 +1,2 @@
+Fixes data type confusion in audit events raised by ``_winapi.CreateFile``
+and ``_winapi.CreateNamedPipe``.
index 1e0e4ec8b3da7f6a6f38b8b45fd16328078d1249..ffcdafa48c038071a8eb4575cd8a351c9aaf7ac8 100644 (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;
     }