From a39d67d8c914d9c34725e1265fdf933614c6726b Mon Sep 17 00:00:00 2001 From: Andrew Wesie Date: Fri, 3 Feb 2017 04:20:39 -0600 Subject: [PATCH] ntdll: Prevent NULL dereference in NtSuspendThread. Overwatch calls NtSuspendThread directly, and expects to be able to pass in a NULL pointer for the count argument. Signed-off-by: Andrew Wesie Signed-off-by: Alexandre Julliard --- 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 6127c8f5dbe..e3cc11ab4f4 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;