wil6210: fix printout in wil_read_pmccfg
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>
This commit is contained in:
@@ -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"
|
" - \"alloc <num descriptors> <descriptor_size>\" to allocate pmc\n"
|
||||||
" - \"free\" to free memory allocated for pmc\n";
|
" - \"free\" to free memory allocated for pmc\n";
|
||||||
|
|
||||||
sprintf(text, "Last command status: %d\n\n%s",
|
snprintf(text, sizeof(text), "Last command status: %d\n\n%s",
|
||||||
wil_pmc_last_cmd_status(wil),
|
wil_pmc_last_cmd_status(wil), help);
|
||||||
help);
|
|
||||||
|
|
||||||
return simple_read_from_buffer(user_buf, count, ppos, text,
|
return simple_read_from_buffer(user_buf, count, ppos, text,
|
||||||
strlen(text) + 1);
|
strlen(text) + 1);
|
||||||
|
Reference in New Issue
Block a user