Andrew Wesie : ntdll: Prevent NULL dereference in NtSuspendThread.

Alexandre Julliard julliard at winehq.org
Fri Feb 3 13:31:33 CST 2017


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

Author: Andrew Wesie <awesie at gmail.com>
Date:   Fri Feb  3 04:20:39 2017 -0600

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 <awesie at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;




More information about the wine-cvs mailing list