Guenter Roeck 1009ccdc64 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>
2017-07-15 16:38:56 -07:00
..
2014-08-04 07:01:35 -07:00
2016-06-27 18:58:04 -07:00
2017-04-02 07:01:53 -07:00
2017-04-02 07:01:53 -07:00
2013-03-18 21:19:49 +01:00
2017-04-02 07:01:53 -07:00
2017-04-13 06:09:26 -07:00
2017-04-02 07:01:53 -07:00
2014-08-04 07:01:35 -07:00
2016-03-05 06:25:34 -08:00
2014-08-04 07:01:35 -07:00
2014-08-04 07:01:35 -07:00
2017-04-30 11:45:31 -07:00
2014-01-29 20:40:08 +01:00
2017-02-16 06:49:05 -08:00
2015-06-21 22:54:53 -07:00
2016-12-02 13:28:05 -08:00