From: Dedy Lansky Date: Sun, 16 Jun 2019 07:26:01 +0000 (+0300) Subject: wil6210: fix printout in wil_read_pmccfg X-Git-Tag: v5.3-rc1~140^2~52^2^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dedec35b40195f56d16386eea51c8255bf034dba;p=thirdparty%2Flinux.git wil6210: fix printout in wil_read_pmccfg Replace sprintf with snprintf which checks the destination buffer size. Signed-off-by: Dedy Lansky Signed-off-by: Maya Erez Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index cfeed928b2ce7..8ac53fb2bb596 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -940,9 +940,8 @@ static ssize_t wil_read_pmccfg(struct file *file, char __user *user_buf, " - \"alloc \" to allocate pmc\n" " - \"free\" to free memory allocated for pmc\n"; - sprintf(text, "Last command status: %d\n\n%s", - wil_pmc_last_cmd_status(wil), - help); + snprintf(text, sizeof(text), "Last command status: %d\n\n%s", + wil_pmc_last_cmd_status(wil), help); return simple_read_from_buffer(user_buf, count, ppos, text, strlen(text) + 1);