diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-04-19 15:14:05 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2021-04-22 17:39:29 +0300 |
commit | a9a4c080deb33f44e08afe35f4ca4bb9ece89f4e (patch) | |
tree | 34bc691b48d164ebb4d929514325800af284bc2f /drivers/net/wireless/quantenna/qtnfmac/debug.c | |
parent | bb43e5718d8f1b46e7a77e7b39be3c691f293050 (diff) | |
download | linux-stable-a9a4c080deb33f44e08afe35f4ca4bb9ece89f4e.tar.gz linux-stable-a9a4c080deb33f44e08afe35f4ca4bb9ece89f4e.tar.bz2 linux-stable-a9a4c080deb33f44e08afe35f4ca4bb9ece89f4e.zip |
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: 7b0e2c4f6be3 ("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
Diffstat (limited to 'drivers/net/wireless/quantenna/qtnfmac/debug.c')
0 files changed, 0 insertions, 0 deletions