]> git.baikalelectronics.ru Git - uboot.git/commit
i2c: fix stack buffer overflow vulnerability in i2c md command
authorMarek Vasut <marex@denx.de>
Fri, 26 Aug 2022 21:15:56 +0000 (23:15 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 31 Aug 2022 16:21:47 +0000 (12:21 -0400)
commit3cfbadc9f66e40ec93242d5c6679c437d95655da
tree20d34ecf4bfa236f68695afac4fff5dc57384b67
parent35dcb8e5dab16bc5a668ea9ec4350b102acd37df
i2c: fix stack buffer overflow vulnerability in i2c md command

This reinstates fix from commit fa6d02c7221e ("i2c: fix stack buffer
overflow vulnerability in i2c md command") without the changes unrelated
to the actual fix. Avoid the underflow by setting only nbytes and
linebytes as unsigned integers.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tim Harvey <tharvey@gateworks.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
cmd/i2c.c