Dmitry Timoshkov : ntdll: Make NtWriteFile explicitly check for negative offset and fail.

Alexandre Julliard julliard at winehq.org
Fri Sep 13 10:15:50 CDT 2013


Module: wine
Branch: master
Commit: b314a253203127a38613d844dc05a82141093cca
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b314a253203127a38613d844dc05a82141093cca

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Fri Sep 13 15:45:44 2013 +0900

ntdll: Make NtWriteFile explicitly check for negative offset and fail.

---

 dlls/ntdll/file.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index dd67b3d..2d07255 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -982,6 +982,11 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
                 }
                 off = st.st_size;
             }
+            else if (offset->QuadPart < 0)
+            {
+                status = STATUS_INVALID_PARAMETER;
+                goto done;
+            }
 
             /* async I/O doesn't make sense on regular files */
             while ((result = pwrite( unix_handle, buffer, length, off )) == -1)




More information about the wine-cvs mailing list