helper/binarybuffer: fix clang static analyzer warnings 83/5383/3
authorTomas Vanek <vanekt@fbl.cz>
Fri, 20 Dec 2019 22:56:08 +0000 (23:56 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Sat, 7 Mar 2020 15:30:05 +0000 (15:30 +0000)
commita2e822834df52efef5e1bbcb91a6eb1afbf102db
tree0e5caf3d1daa7dfeb6cabc7f3163d6dd5bbc73f9
parent4e981bc27c36e696dc8ace3ab4bab534564770c1
helper/binarybuffer: fix clang static analyzer warnings

Writing bits to an uninitialized buffer generated false warnings.
Zero buffers before setting them by buf_set_u32|64()
(do it only if bit-by-bit copy loop is used,
zeroed buffer is not necessary if a fast path write is used)

Change-Id: I2f7f8ddb45b0cbd08d3e249534fc51f4b5cc6694
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5383
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
16 files changed:
src/flash/nor/jtagspi.c
src/helper/binarybuffer.h
src/jtag/core.c
src/jtag/tcl.c
src/target/arm_jtag.c
src/target/avr32_jtag.c
src/target/esirisc_jtag.c
src/target/etb.c
src/target/etm.c
src/target/ls1_sap.c
src/target/mips_ejtag.c
src/target/openrisc/or1k_tap_vjtag.c
src/target/riscv/riscv-011.c
src/target/riscv/riscv-013.c
src/target/riscv/riscv.c
src/target/xscale.c