]> git.dujemihanovic.xyz Git - u-boot.git/commit
easylogo: avoid buffer overrun
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 15 Aug 2019 21:54:15 +0000 (23:54 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 20 Aug 2019 16:20:33 +0000 (12:20 -0400)
commitcd1db463539fdb51716ca48603c4b1b922cb5aaf
treea1a965e115ca08c5fe83fea1813e531592e352a9
parentad49488ffb0dd6357139f74a6b88c0b51e1ac215
easylogo: avoid buffer overrun

Building easylogo with `HOST_TOOLS_ALL=y make tools` results in a build
warning due to a possible buffer overrun:

tools/easylogo/easylogo.c:453:4: note: ‘sprintf’ output between 7 and
262 bytes into a destination of size 256
    sprintf (str, "%s, 0x%02x", app, *dataptr++);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Truncate the output to fit into the destination buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
tools/easylogo/easylogo.c