Commit 3c2c4437 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

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

parent ce07be1a
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment