mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-18 16:44:33 +00:00
ASoC: SOF: debug: Fix a potential issue on string buffer termination
[ Upstream commit9037c3bde6
] The function simple_write_to_buffer() doesn't add string termination at the end of buf, we need to handle it on our own. This change refers to the function tokenize_input() in debug.c and the function sof_dfsentry_trace_filter_write() in trace.c. Fixes:091c12e1f5
("ASoC: SOF: debug: add new debugfs entries for IPC flood test") Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20210208103857.75705-1-hui.wang@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
624d18332e
commit
790c0dcbb5
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ static ssize_t sof_dfsentry_write(struct file *file, const char __user *buffer,
|
|||
char *string;
|
||||
int ret;
|
||||
|
||||
string = kzalloc(count, GFP_KERNEL);
|
||||
string = kzalloc(count+1, GFP_KERNEL);
|
||||
if (!string)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
Loading…
Reference in a new issue