2
0
mirror of git://git.code.sf.net/p/openocd/code synced 2025-08-05 17:40:16 +10:00
openocd/src/target
Antonio Borneo 7a09635735 openrisc: fix clang error core.CallAndMessage
Clang assumes that size could assume a value that is not 1 nor 2
nor 4. In such condition the buffer in t is allocated (size != 1)
and not initialized. This triggers an error:
  src/target/openrisc/or1k_du_adv.c:655:14: warning: 2nd function
    call argument is an uninitialized value [core.CallAndMessage]
                crc_calc = adbg_compute_crc(crc_calc, data[i], 8);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add the default case to cover other values of size.

After this fix, clang still complains on the same line, this time
misunderstanding the limits of the loop and considering that
buf_bswap16() only swaps the first 16 bits, thus passing not
initialized value data[2] to adbg_compute_crc()

Replace malloc() with calloc() to silent it.

Change-Id: I358d7fb2ebefd69255670641bd435b770762a301
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7300
Tested-by: jenkins
2022-11-11 20:10:41 +00:00
..
espressif target/esp32s2: check xtensa_poll return value 2022-10-15 15:57:57 +00:00
openrisc openrisc: fix clang error core.CallAndMessage 2022-11-11 20:10:41 +00:00
riscv doc: fix riscv commands 2022-10-21 18:14:46 +00:00
xtensa target/xtensa: remove redundant call for TARGET_EVENT_HALTED 2022-10-21 18:16:23 +00:00
a64_disassembler.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
a64_disassembler.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
aarch64.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
aarch64.h target: move parent target structs just after common_magic 2022-08-14 12:10:14 +00:00
adi_v5_dapdirect.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
adi_v5_jtag.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
adi_v5_swd.c target/adi_v5_swd: suppress reconnect in swd_multidrop_select() 2022-09-27 08:29:00 +00:00
algorithm.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
algorithm.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arc_cmd.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arc_cmd.h openocd: src: fix incorrect SPDX tags 2022-07-23 13:16:09 +00:00
arc_jtag.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arc_jtag.h openocd: src: fix incorrect SPDX tags 2022-07-23 13:16:09 +00:00
arc_mem.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arc_mem.h openocd: src: fix incorrect SPDX tags 2022-07-23 13:16:09 +00:00
arc.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arc.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
arm7_9_common.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm7_9_common.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
arm7tdmi.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm7tdmi.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm9tdmi.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm9tdmi.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm11_dbgtap.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm11_dbgtap.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm11.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm11.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm720t.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm720t.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
arm920t.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm920t.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
arm926ejs.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm926ejs.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
arm946e.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm946e.h target: don't export local symbols 2022-09-13 22:13:58 +00:00
arm966e.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm966e.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
arm_adi_v5.c target/adiv5: 64-bit TAR setup bugfix 2022-10-08 07:55:35 +00:00
arm_adi_v5.h arm_adi_v5: Adding Nuvoton NPCX quirk 2022-07-30 08:49:47 +00:00
arm_coresight.h arm_adi_v5: replace dap_lookup_cs_component() 2022-05-14 08:55:52 +00:00
arm_cti.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_cti.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_dap.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_disassembler.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_disassembler.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_dpm.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_dpm.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_jtag.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_jtag.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_opcodes.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_semihosting.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_semihosting.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_simulator.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_simulator.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
arm_tpiu_swo.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
arm_tpiu_swo.h armv7m_trace: get rid of the old tpiu code 2021-03-10 21:34:04 +00:00
arm.h target: don't export local symbols 2022-09-13 22:13:58 +00:00
armv4_5_cache.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv4_5_cache.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv4_5_mmu.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv4_5_mmu.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv4_5.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv4_5.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv7a_cache_l2x.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv7a_cache_l2x.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv7a_cache.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv7a_cache.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv7a_mmu.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv7a_mmu.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv7a.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv7a.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
armv7m_trace.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv7m_trace.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv7m.c target/armv7m: show target name in 'halted' message 2022-10-08 07:47:09 +00:00
armv7m.h openocd: remove CamelCase symbols *xPSR* 2022-09-13 22:03:02 +00:00
armv8_cache.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv8_cache.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
armv8_dpm.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv8_dpm.h openocd: src: replace the incomplete GPL-2.0-or-later license tag 2022-07-23 13:15:24 +00:00
armv8_opcodes.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv8_opcodes.h openocd: remove CamelCase symbols *xPSR* 2022-09-13 22:03:02 +00:00
armv8.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
armv8.h openocd: remove CamelCase symbols *xPSR* 2022-09-13 22:03:02 +00:00
avr32_ap7k.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
avr32_ap7k.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
avr32_jtag.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
avr32_jtag.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
avr32_mem.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
avr32_mem.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
avr32_regs.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
avr32_regs.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
avrt.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
avrt.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
breakpoints.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
breakpoints.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
cortex_a.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
cortex_a.h target: move parent target structs just after common_magic 2022-08-14 12:10:14 +00:00
cortex_m.c target/cortex_m: try to re-examine under reset in cortex_m_assert_reset() 2022-10-08 08:49:52 +00:00
cortex_m.h target/arm: Add support with identify STAR-MC1 2022-09-03 21:26:20 +00:00
dsp563xx_once.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
dsp563xx_once.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
dsp563xx.c target/dsp563xx: fix scan-build warning 2022-09-23 21:22:09 +00:00
dsp563xx.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
dsp5680xx.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
dsp5680xx.h target: don't export local symbols 2022-09-13 22:13:58 +00:00
embeddedice.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
embeddedice.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
esirisc_jtag.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
esirisc_jtag.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
esirisc_regs.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
esirisc_trace.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
esirisc_trace.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
esirisc.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
esirisc.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
etb.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
etb.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
etm_dummy.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
etm_dummy.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
etm.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
etm.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
fa526.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
feroceon.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
hla_target.c target/hla_target: try to re-examine under reset in hl_assert_reset() 2022-10-08 08:52:45 +00:00
image.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
image.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
lakemont.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
lakemont.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
ls1_sap.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
Makefile.am openocd: build: add SPDX tag 2022-07-23 13:06:38 +00:00
mem_ap.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips32_dmaacc.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips32_dmaacc.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
mips32_pracc.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips32_pracc.h target: don't export local symbols 2022-09-13 22:13:58 +00:00
mips32.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips32.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
mips64_pracc.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips64_pracc.h
mips64.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips64.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
mips_ejtag.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips_ejtag.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
mips_m4k.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips_m4k.h target: don't export local symbols 2022-09-13 22:13:58 +00:00
mips_mips64.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
mips_mips64.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
nds32_aice.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_aice.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_cmd.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_cmd.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_disassembler.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_disassembler.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_edm.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_insn.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_reg.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_reg.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_tlb.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_tlb.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_v2.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_v2.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_v3_common.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_v3_common.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_v3.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_v3.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32_v3m.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32_v3m.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
nds32.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
nds32.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
quark_d20xx.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
quark_x10xx.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
register.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
register.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
rtt.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
rtt.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
semihosting_common.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
semihosting_common.h openocd: remove recently added CamelCase symbols 2022-09-13 22:02:33 +00:00
smp.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
smp.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
startup.tcl target: re-examine before arp_waitstate in ocd_process_reset_inner 2022-10-08 08:53:51 +00:00
stm8.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
stm8.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
target_request.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
target_request.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
target_type.h gdb_server: custom target-specific GDB queries 2022-08-15 13:23:05 +00:00
target.c target/target: read_memory 64-bit bugfix 2022-09-23 21:26:44 +00:00
target.h openocd: remove recently added CamelCase symbols 2022-09-13 22:02:33 +00:00
testee.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
trace.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
trace.h openocd: src/target: replace the GPL-2.0-or-later license tag 2022-07-23 13:58:51 +00:00
x86_32_common.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
x86_32_common.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00
xscale.c openocd: fix SPDX tag format for files .c 2022-09-18 08:22:01 +00:00
xscale.h target: consolidate existing target/algo common_magic 2022-08-14 12:02:38 +00:00