]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wil6210: fix printout in wil_read_pmccfg
authorDedy Lansky <dlansky@codeaurora.org>
Sun, 16 Jun 2019 07:26:01 +0000 (10:26 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Jun 2019 17:50:10 +0000 (20:50 +0300)
Replace sprintf with snprintf which checks the destination buffer
size.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wil6210/debugfs.c

index cfeed928b2ce74d52cc8d3fb2d6e08f4d2ba5dd1..8ac53fb2bb596e81165b30db80e0f38d7ace0e0f 100644 (file)
@@ -940,9 +940,8 @@ static ssize_t wil_read_pmccfg(struct file *file, char __user *user_buf,
        " - \"alloc <num descriptors> <descriptor_size>\" 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);