mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09: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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user