[PATCH] winedbg: Don't dereference possibly NULL thread pointer.
Rémi Bernon
rbernon at codeweavers.com
Tue Mar 9 16:50:13 CST 2021
On 3/9/21 11:19 PM, Zebediah Figura (she/her) wrote:
> On 3/9/21 3:54 PM, Rémi Bernon wrote:
>> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
>> ---
>> programs/winedbg/gdbproxy.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
>> index 41aee55656b..bf96482042a 100644
>> --- a/programs/winedbg/gdbproxy.c
>> +++ b/programs/winedbg/gdbproxy.c
>> @@ -115,11 +115,11 @@ struct gdb_context
>> static void gdbctx_delete_xpoint(struct gdb_context *gdbctx, struct
>> dbg_thread *thread,
>> dbg_ctx_t *ctx, struct gdb_xpoint *x)
>> {
>> - struct dbg_process *process = thread->process;
>> + struct dbg_process *process = gdbctx->process;
>> struct backend_cpu *cpu = process->be_cpu;
>> if (!cpu->remove_Xpoint(process->handle, process->process_io,
>> ctx, x->type, x->addr, x->value, x->size))
>> - ERR("%04x:%04x: Couldn't remove breakpoint at:%p/%x
>> type:%d\n", process->pid, thread->tid, x->addr, x->size, x->type);
>> + ERR("%04x:%04x: Couldn't remove breakpoint at:%p/%x
>> type:%d\n", process->pid, thread ? thread->tid : ~0, x->addr, x->size,
>> x->type);
>> list_remove(&x->entry);
>> HeapFree(GetProcessHeap(), 0, x);
>>
>
> Is there any point in passing the thread to this function?
>
Print its id, like in the other messages I guess?
--
Rémi Bernon <rbernon at codeweavers.com>
More information about the wine-devel
mailing list