openocd/src
Antonio Borneo 334c5096eb gdb_server: fix 'null' pointer passed as 'nonnull' parameter
The null pointer used as second parameter to gdb_put_packet() is
passed as second parameter to the memcpy() in line 408 of
gdb_put_packet_inner(). In this case memcpy() does not segfault
because also the parameter length is zero. Nevertheless, the
prototype of memcpy() requires a nonnull pointer.

Fixed by passing an empty string in place of the null pointer.

Issue highlighted by clang 7.0.0 with warning message:
"Null pointer passed as an argument to a 'nonnull' parameter"

Change-Id: Ib3dde95d76fcc5fb245ee2d6669e5535d0e0b127
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4946
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-03-06 15:35:16 +00:00
..
flash flash: stm32f2/f4/f7: Add One-Time-Porgrammable (OTP) support 2019-02-27 00:16:50 +00:00
helper command: check command mode for native jim commands 2019-01-27 20:59:42 +00:00
jtag src/jtag/drivers/ftdi: fix swd pin comment and links 2019-03-05 08:04:47 +00:00
pld Convert to non-recursive make 2016-12-08 16:23:10 +00:00
rtos rtos: Add RTOS task awareness for Chromium-EC 2019-01-23 15:27:01 +00:00
server gdb_server: fix 'null' pointer passed as 'nonnull' parameter 2019-03-06 15:35:16 +00:00
svf svf: improve robustness when processing invalid SVF files 2018-03-13 08:41:21 +00:00
target armv8: allow halt on exception 2019-03-04 11:53:00 +00:00
transport configure: disable all drivers when zy1000 is enabled 2018-04-09 09:04:46 +01:00
xsvf Convert to non-recursive make 2016-12-08 16:23:10 +00:00
hello.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
hello.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
main.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
Makefile.am Convert to non-recursive make 2016-12-08 16:23:10 +00:00
openocd.c armv8: valgrind memleak fixes 2018-04-10 09:13:02 +01:00
openocd.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00