]> git.baikalelectronics.ru Git - kernel.git/commit
staging: most: use format specifier "%s" in snprintf
authorColin Ian King <colin.king@canonical.com>
Fri, 9 Nov 2018 11:56:45 +0000 (11:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Nov 2018 12:34:12 +0000 (04:34 -0800)
commitc880b59db63db501ed52686a59b11a33867e4879
treef60061bdcd0e0ac94d3c261f69978035ccaade97
parent8194b3ed1c8229b7ac5c0b043210813592301c11
staging: most: use format specifier "%s" in snprintf

Passing string ch_data_type[i].name as the format specifier is
potentially hazardous because it could (although very unlikely to)
have a format specifier embedded in it causing issues when parsing
the non-existent arguments to these.  Follow best practice by using
the "%s" format string for the string.

Cleans up clang warning:
format string is not a string literal (potentially insecure) [-Wformat-security]

Fixes: bbd3a2b865c6 ("staging: most: replace multiple if..else with table lookup")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/core.c