winedbg: Sanity check the dwType field of MSVC thread naming exceptions.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Brendan Shanks 2022-02-24 10:34:02 -08:00 committed by Alexandre Julliard
parent 24c10e700c
commit ce07be1a79
2 changed files with 5 additions and 0 deletions

View File

@ -485,6 +485,8 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e
char name[9];
SIZE_T read;
if (threadname->dwType != 0x1000)
return FALSE;
if (threadname->dwThreadID == -1)
thread = dbg_get_thread(gdbctx->process, gdbctx->de.dwThreadId);
else

View File

@ -245,6 +245,9 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
break;
case EXCEPTION_WINE_NAME_THREAD:
pThreadName = (const THREADNAME_INFO*)(rec->ExceptionInformation);
if (pThreadName->dwType != 0x1000)
return DBG_EXCEPTION_NOT_HANDLED;
if (pThreadName->dwThreadID == -1)
pThread = dbg_curr_thread;
else