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:
Родитель
32521a9138
Коммит
5cb5b4759c
|
@ -45,7 +45,7 @@
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
|
||||||
#define ADD(buf, off, max, fmt, args...) \
|
#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 {
|
struct carl9170_debugfs_fops {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче