ntdll: Check for NULL context in NtGetContextThread.
Crash Bandicoot N. Sane Trilogy calls NtGetContextThread with the context being set to NULL which leads to a crash. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45428 Signed-off-by: Johannes Brandstätter <jbrandst@2ds.eu> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
95c21f3f94
commit
ec418e7f55
|
@ -2160,9 +2160,13 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
|
||||||
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
|
NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
|
||||||
{
|
{
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
DWORD needed_flags = context->ContextFlags;
|
DWORD needed_flags;
|
||||||
BOOL self = (handle == GetCurrentThread());
|
BOOL self = (handle == GetCurrentThread());
|
||||||
|
|
||||||
|
if (!context) return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
needed_flags = context->ContextFlags;
|
||||||
|
|
||||||
/* debug registers require a server call */
|
/* debug registers require a server call */
|
||||||
if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64)) self = FALSE;
|
if (context->ContextFlags & (CONTEXT_DEBUG_REGISTERS & ~CONTEXT_AMD64)) self = FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue