Commit b314a253 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent 9e50cc54
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment