mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 21:55:36 +07:00
carl9170: Use scnprintf() for avoiding potential buffer overflow
Since snprintf() returns the would-be-output size instead of the actual output size, the succeeding calls may go beyond the given buffer limit. Fix it by replacing with scnprintf(). Cc: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
32521a9138
commit
5cb5b4759c
@ -45,7 +45,7 @@
|
||||
#include "cmd.h"
|
||||
|
||||
#define ADD(buf, off, max, fmt, args...) \
|
||||
off += snprintf(&buf[off], max - off, fmt, ##args);
|
||||
off += scnprintf(&buf[off], max - off, fmt, ##args);
|
||||
|
||||
|
||||
struct carl9170_debugfs_fops {
|
||||
|
Loading…
Reference in New Issue
Block a user