diff options
author | Guenter Roeck <linux@roeck-us.net> | 2017-07-12 06:53:55 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-07-16 02:38:56 +0300 |
commit | 1009ccdc64ee2c8451f76b548589f6b989d13412 (patch) | |
tree | 1550e7c64fa36ed378ae26a874d9a694027d4d5a /drivers/hwmon/sch5627.c | |
parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) | |
download | linux-1009ccdc64ee2c8451f76b548589f6b989d13412.tar.xz |
hwmon: (applesmc) Avoid buffer overruns
gcc 7.1 complains that the driver uses sprintf() and thus does not validate
the length of output buffers.
drivers/hwmon/applesmc.c: In function 'applesmc_show_fan_position':
drivers/hwmon/applesmc.c:82:21: warning:
'%d' directive writing between 1 and 5 bytes into a region of size 4
Fix the problem by using scnprintf() instead of sprintf() throughout the
driver. Also explicitly limit the number of supported fans to avoid actual
buffer overruns and thus invalid keys.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/sch5627.c')
0 files changed, 0 insertions, 0 deletions