From: David B. <dbr...@us...> - 2009-12-31 02:02:13
|
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 3ed254c18aa7fc24cbc692433729ec3819fc5537 (commit) from 7c5acf8660ddfce4746152e03749b699532f513f (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 3ed254c18aa7fc24cbc692433729ec3819fc5537 Author: Antonio Borneo <bor...@gm...> Date: Thu Dec 31 07:13:16 2009 +0800 ARM7_9: Fix segfaults Handlers for commands - arm7_9 semihosting <enable | disable> - $_TARGETNAME arp_reset assert 1 didn't check if target has already been examined, and could segfault when using the NULL pointer "arm7_9->eice_cache". Signed-off-by: Antonio Borneo <bor...@gm...> Signed-off-by: David Brownell <dbr...@us...> diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c index e596980..a09b0ad 100644 --- a/src/target/arm7_9_common.c +++ b/src/target/arm7_9_common.c @@ -2797,6 +2797,12 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command) COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting); + if (!target_was_examined(target)) + { + LOG_ERROR("Target not examined yet"); + return ERROR_FAIL; + } + if (arm7_9->has_vector_catch) { struct reg *vector_catch = &arm7_9->eice_cache ->reg_list[EICE_VEC_CATCH]; diff --git a/src/target/target.c b/src/target/target.c index 8cb53b3..d3d1bee 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4079,6 +4079,11 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv) struct target *target = Jim_CmdPrivData(goi.interp); if (!target->tap->enabled) return jim_target_tap_disabled(interp); + if (!(target_was_examined(target))) + { + LOG_ERROR("Target not examined yet"); + return ERROR_TARGET_NOT_EXAMINED; + } if (!target->type->assert_reset || !target->type->deassert_reset) { Jim_SetResult_sprintf(interp, ----------------------------------------------------------------------- Summary of changes: src/target/arm7_9_common.c | 6 ++++++ src/target/target.c | 5 +++++ 2 files changed, 11 insertions(+), 0 deletions(-) hooks/post-receive -- Main OpenOCD repository |