From: openocd-gerrit <ope...@us...> - 2024-05-04 08:36:05
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3eba7b53bf067508197e2455b81fc1375b1d945e (commit) from c72afedce794a7251fd9c822e3bfc89f870b9fc1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3eba7b53bf067508197e2455b81fc1375b1d945e Author: Antonio Borneo <bor...@gm...> Date: Mon Apr 15 17:42:12 2024 +0200 smp: fix SIGSEGV for "smp off" during target examine The gdb subsystem is initialized after the first target examine, so the field struct target::gdb_service is NULL during examine. A command "smp off" in the examine event handler causes a SIGSEGV during OpenOCD startup. Check for pointer not NULL before dereferencing it. Change-Id: Id115e28be23a957fef1b97ab66d7273f0ea0dce4 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8216 Tested-by: jenkins diff --git a/src/target/smp.c b/src/target/smp.c index 50b19d01a..41ca880d4 100644 --- a/src/target/smp.c +++ b/src/target/smp.c @@ -119,7 +119,7 @@ COMMAND_HANDLER(default_handle_smp_command) head->target->smp = 0; /* fixes the target display to the debugger */ - if (!list_empty(target->smp_targets)) + if (!list_empty(target->smp_targets) && target->gdb_service) target->gdb_service->target = target; return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/target/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |