ntdll: Prevent NULL dereference in NtSuspendThread
Andrew Wesie
awesie at gmail.com
Fri Feb 3 04:20:39 CST 2017
Overwatch calls NtSuspendThread directly, and expects to be able to pass in a
NULL pointer for the count argument.
Fix by checking whether count is NULL before the assignment. Also apply the
same fix to NtResumeThread as a precaution.
Signed-off-by: Andrew Wesie <awesie at gmail.com>
---
dlls/ntdll/thread.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index 6127c8f..e3cc11a 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -632,7 +632,10 @@ NTSTATUS WINAPI NtSuspendThread( HANDLE handle, PULONG count )
SERVER_START_REQ( suspend_thread )
{
req->handle = wine_server_obj_handle( handle );
- if (!(ret = wine_server_call( req ))) *count = reply->count;
+ if (!(ret = wine_server_call( req )))
+ {
+ if (count) *count = reply->count;
+ }
}
SERVER_END_REQ;
return ret;
@@ -650,7 +653,10 @@ NTSTATUS WINAPI NtResumeThread( HANDLE handle, PULONG count )
SERVER_START_REQ( resume_thread )
{
req->handle = wine_server_obj_handle( handle );
- if (!(ret = wine_server_call( req ))) *count = reply->count;
+ if (!(ret = wine_server_call( req )))
+ {
+ if (count) *count = reply->count;
+ }
}
SERVER_END_REQ;
return ret;
--
2.7.4
More information about the wine-patches
mailing list