From: OpenOCD-Gerrit <ope...@us...> - 2021-12-11 17:42:14
|
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 d7142a57271079eca8e1c15034b74499ff4e3ef5 (commit) from 2753c9868e28467e700799a8584b589af9e88600 (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 d7142a57271079eca8e1c15034b74499ff4e3ef5 Author: Yasushi SHOJI <ya...@sp...> Date: Mon Nov 29 22:33:27 2021 +0900 target/target: Check checksum_memory before call Make sure checksum_memory is present. Otherwise it'll segfault. Change-Id: If31123323bd8a03282da43505c9604fde735ad0e Signed-off-by: Yasushi SHOJI <ya...@sp...> Reviewed-on: https://review.openocd.org/c/openocd/+/6758 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/target.c b/src/target/target.c index 27888a83e..e9cbe39b7 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -2530,6 +2530,10 @@ int target_checksum_memory(struct target *target, target_addr_t address, uint32_ LOG_ERROR("Target not examined yet"); return ERROR_FAIL; } + if (!target->type->checksum_memory) { + LOG_ERROR("Target %s doesn't support checksum_memory", target_name(target)); + return ERROR_FAIL; + } retval = target->type->checksum_memory(target, address, size, &checksum); if (retval != ERROR_OK) { ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- Main OpenOCD repository |