riscv-openocd/src
Antonio Borneo 42f70a3b95 target: aarch64: fix out-of-bound access to array
The command 'arm core_state' uses the enum in 'arm->core_state' as
an index in the table of strings to print the core state.

With [1] the enum has been extended with the new state for AArch64
but not the corresponding table of strings.
This causes an access after the limit of arm_state_strings[].

Rewrite the table using c99 array designators to better show the
link between the enum list and the table.
Add the function arm_core_state_string() to check for out-of-bound
values allover the file.

Change-Id: I06473c2c8088b38ee07118bcc9e49bc8eafbc6e2
Fixes: [1] 9cbfc9feb3 ("arm_dpm: Add new state ARM_STATE_AARCH64")
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8594
Tested-by: jenkins
2024-12-22 09:50:50 +00:00
..
flash flash/nor/sfdp: Fix broken DEBUG log line on macOS 2024-12-21 10:25:58 +00:00
helper helper/jim-nvp.h: Rework 'isconfigure' variable 2024-11-23 13:48:52 +00:00
jtag enable the Bus Pirate adapter by default on most systems 2024-11-23 13:49:42 +00:00
pld pld: make get_pld_device_by_num() static 2024-11-23 13:46:59 +00:00
rtos rtos: Remove 'ERROR: ' prefix in error log 2024-11-23 13:53:24 +00:00
rtt rtt: drop unused function rtt_started() 2024-11-23 13:46:35 +00:00
server rtt server: fix for dropped data when target has no space 2024-12-22 09:43:37 +00:00
svf openocd: convert 'unsigned' to 'unsigned int' 2024-10-05 15:46:25 +00:00
target target: aarch64: fix out-of-bound access to array 2024-12-22 09:50:50 +00:00
transport openocd: convert 'unsigned' to 'unsigned int' 2024-10-05 15:46:25 +00:00
xsvf openocd: convert 'unsigned' to 'unsigned int' 2024-10-05 15:46:25 +00:00
Makefile.am configure: Use pkg-config for jimtcl 2024-08-02 15:59:07 +00:00
hello.c hello: include hello.h 2023-05-18 10:13:41 +00:00
hello.h openocd: src: replace the GPL-2.0-or-later license tag 2022-07-23 13:59:13 +00:00
main.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
openocd.c autoconf: Add support for code coverage 2024-11-16 14:18:57 +00:00
openocd.h openocd: src: replace the GPL-2.0-or-later license tag 2022-07-23 13:59:13 +00:00