]> git.dujemihanovic.xyz Git - u-boot.git/commit
arm64: zynqmp: avoid out of buffer access
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 30 Jul 2017 20:18:18 +0000 (22:18 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 2 Aug 2017 07:11:52 +0000 (09:11 +0200)
commitdf1cd46fb84922735e1c12f54b7202b0268dcddd
tree1b5d9af441de42562408e954be4a8735b72aea6b
parent74ba69db35954e473a27711de89dae9572913478
arm64: zynqmp: avoid out of buffer access

strncat(a, b, c) appends a maximum of c characters plus the 0 byte
to a.

In board_init we first write 4 characters plus 0 byte to version.
So only ZYNQMP_VERSION_SIZE - 5 additional characters fit into
version.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/zynqmp/zynqmp.c