Skip to content

Commit

Permalink
ARM9TDMI: Fix segfault.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Brownell <[email protected]>
  • Loading branch information
borneoa authored and David Brownell committed Dec 30, 2009
1 parent c116d8f commit 17fb7ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/target/arm9tdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 17fb7ea

Please sign in to comment.