summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2009-12-31 02:43:56 +0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-12-30 11:51:29 -0800
commit17fb7ead4b901f10c01c0824f594d91775b012b3 (patch)
tree54bdfde71196c00e7331c7a04c9fad7f78acfe84
parentc116d8f6bcb745ccc8fb8e6b562c8f22d54cd003 (diff)
downloadopenocd_libswd-17fb7ead4b901f10c01c0824f594d91775b012b3.tar.gz
openocd_libswd-17fb7ead4b901f10c01c0824f594d91775b012b3.tar.bz2
openocd_libswd-17fb7ead4b901f10c01c0824f594d91775b012b3.tar.xz
openocd_libswd-17fb7ead4b901f10c01c0824f594d91775b012b3.zip
ARM9TDMI: Fix segfault.
The handler for "arm9tdmi vector_catch ..." did not check if target has already been examined. Without this fix it segfaults when using NULL pointer "arm7_9->eice_cache". Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
-rw-r--r--src/target/arm9tdmi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/target/arm9tdmi.c b/src/target/arm9tdmi.c
index 0e99cd1e..ae0c4e05 100644
--- a/src/target/arm9tdmi.c
+++ b/src/target/arm9tdmi.c
@@ -834,6 +834,12 @@ COMMAND_HANDLER(handle_arm9tdmi_catch_vectors_command)
struct reg *vector_catch;
uint32_t vector_catch_value;
+ if (!target_was_examined(target))
+ {
+ LOG_ERROR("Target not examined yet");
+ return ERROR_FAIL;
+ }
+
/* it's uncommon, but some ARM7 chips can support this */
if (arm7_9->common_magic != ARM7_9_COMMON_MAGIC
|| !arm7_9->has_vector_catch) {