summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2022-07-25 10:37:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-25 11:11:27 +0200
commit65dad30796ee1bed0c349efb790403cf870a5e41 (patch)
treea450dbc6a563bd3d1c71e99335c8dda47c6f2776 /tools/lib
parent76b3f0a0b56e53a960a14624a0f48b3d94b5e7e7 (diff)
downloadlinux-stable-65dad30796ee1bed0c349efb790403cf870a5e41.tar.gz
linux-stable-65dad30796ee1bed0c349efb790403cf870a5e41.tar.bz2
linux-stable-65dad30796ee1bed0c349efb790403cf870a5e41.zip
tools/thermal: Fix possible path truncations
[ Upstream commit 6c58cf40e3a1d2f47c09d3489857e9476316788a ] 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: 94f69966faf8 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/lib')
0 files changed, 0 insertions, 0 deletions