winedbg: Ensure thread->name is null-terminated.

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:03 -08:00 committed by Alexandre Julliard
parent ce07be1a79
commit 3c2c443796
1 changed files with 5 additions and 2 deletions

View File

@ -257,9 +257,12 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
dbg_printf("Thread ID=%04lx not in our list of threads -> can't rename\n", pThreadName->dwThreadID);
return DBG_CONTINUE;
}
if (dbg_read_memory(pThreadName->szName, pThread->name, 9))
dbg_printf("Thread ID=%04lx renamed using MS VC6 extension (name==\"%.9s\")\n",
if (dbg_read_memory(pThreadName->szName, pThread->name, sizeof(pThread->name)))
{
pThread->name[sizeof(pThread->name) - 1] = '\0';
dbg_printf("Thread ID=%04lx renamed using MSVC extension (name==\"%s\")\n",
pThread->tid, pThread->name);
}
return DBG_CONTINUE;
case EXCEPTION_INVALID_HANDLE:
return DBG_CONTINUE;