linux/tools/thermal
Florian Fainelli 6c58cf40e3 tools/thermal: Fix possible path truncations
A build with -D_FORTIFY_SOURCE=2 enabled will produce the following warnings:

sysfs.c:63:30: warning: '%s' directive output may be truncated writing up to 255 bytes into a region of size between 0 and 255 [-Wformat-truncation=]
  snprintf(filepath, 256, "%s/%s", path, filename);
                              ^~
Bump up the buffer to PATH_MAX which is the limit and account for all of
the possible NUL and separators that could lead to exceeding the
allocated buffer sizes.

Fixes: 94f69966fa ("tools/thermal: Introduce tmon, a tool for thermal subsystem")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2022-08-03 19:28:46 +02:00
..
lib tools/thermal: Add util library 2022-05-19 12:11:51 +02:00
thermal-engine tools/thermal: Add thermal daemon skeleton 2022-05-19 12:11:52 +02:00
thermometer tools/thermal: remove unneeded semicolon 2022-05-19 12:11:52 +02:00
tmon tools/thermal: Fix possible path truncations 2022-08-03 19:28:46 +02:00