android_kernel_xiaomi_sm8350/tools
Florian Fainelli 09777c16a0 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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-25 11:18:09 +02:00
..
accounting
arch x86/speculation: Add RSB VM Exit protections 2022-08-11 12:57:53 +02:00
bpf
build tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts 2022-04-15 14:18:40 +02:00
cgroup
debugging
firewire
firmware
gpio
hv
iio
include selftests/bpf: Extend verifier and bpf_sock tests for dst_port loads 2022-08-11 12:57:51 +02:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix the name of a reused map 2022-08-25 11:17:43 +02:00
memory-model
nfsd
objtool x86/xen: Mark cpu_bringup_and_idle() as dead_end_function 2022-05-25 09:14:38 +02:00
pci
pcmcia
perf genelf: Use HAVE_LIBCRYPTO_SUPPORT, not the never defined HAVE_LIBCRYPTO 2022-08-25 11:18:08 +02:00
power tools/power turbostat: fix ICX DRAM power numbers 2022-06-14 18:11:25 +02:00
scripts
spi
testing selftests/bpf: fix a test for snprintf() overflow 2022-08-25 11:17:45 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-25 11:18:09 +02:00
time
usb
virtio
vm
wmi
Makefile