Commit dedec35b authored by Dedy Lansky's avatar Dedy Lansky Committed by Kalle Valo
Browse files

wil6210: fix printout in wil_read_pmccfg



Replace sprintf with snprintf which checks the destination buffer
size.

Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c5b3a658
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);