OpenCloudOS-Kernel/drivers/net/wireless/ti
Colin Ian King a9a4c080de wlcore: Fix buffer overrun by snprintf due to incorrect buffer size
The size of the buffer than can be written to is currently incorrect, it is
always the size of the entire buffer even though the snprintf is writing
as position pos into the buffer. Fix this by setting the buffer size to be
the number of bytes left in the buffer, namely sizeof(buf) - pos.

Addresses-Coverity: ("Out-of-bounds access")
Fixes: 7b0e2c4f6b ("wlcore: fix overlapping snprintf arguments in debugfs")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210419141405.180582-1-colin.king@canonical.com
2021-04-22 17:39:29 +03:00
..
wl12xx wlcore: Fix command execute failure 19 for wl12xx 2021-01-25 16:42:12 +02:00
wl18xx treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
wl1251 wl1251: cmd: remove redundant assignment 2021-02-08 13:17:59 +02:00
wlcore wlcore: Fix buffer overrun by snprintf due to incorrect buffer size 2021-04-22 17:39:29 +03:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wilink_platform_data.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336 2019-06-05 17:37:07 +02:00