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

This commit is contained in:
Dmitry Timoshkov 2013-09-13 15:45:44 +09:00 committed by Alexandre Julliard
parent 9e50cc540a
commit b314a25320
1 changed files with 5 additions and 0 deletions

View File

@ -982,6 +982,11 @@ NTSTATUS WINAPI NtWriteFile(HANDLE hFile, HANDLE hEvent,
} }
off = st.st_size; 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 */ /* async I/O doesn't make sense on regular files */
while ((result = pwrite( unix_handle, buffer, length, off )) == -1) while ((result = pwrite( unix_handle, buffer, length, off )) == -1)