Daniel Bristot de Oliveira
8a585914c2
tools/rtla: Fix clang warning about mount_point var size
...
commit 30369084ac6e27479a347899e74f523e6ca29b89 upstream.
clang is reporting this warning:
$ make HOSTCC=clang CC=clang LLVM_IAS=1
[...]
clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions
-fstack-protector-strong -fasynchronous-unwind-tables
-fstack-clash-protection -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
$(pkg-config --cflags libtracefs) -c -o src/utils.o src/utils.c
src/utils.c:548:66: warning: 'fscanf' may overflow; destination buffer in argument 3 has size 1024, but the corresponding specifier may require size 1025 [-Wfortify-source]
548 | while (fscanf(fp, "%*s %" STR(MAX_PATH) "s %99s %*s %*d %*d\n", mount_point, type) == 2) {
| ^
Increase mount_point variable size to MAX_PATH+1 to avoid the overflow.
Link: https://lkml.kernel.org/r/1b46712e93a2f4153909514a36016959dcc4021c.1707217097.git.bristot@kernel.org
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Donald Zickus <dzickus@redhat.com>
Fixes: a957cbc02531 ("rtla: Add -C cgroup support")
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:25:14 +01:00
..
2024-02-23 09:24:47 +01:00
2024-01-10 17:16:54 +01:00
2024-02-05 20:14:31 +00:00
2023-08-08 15:43:03 -06:00
2023-07-24 10:29:52 -04:00
2023-11-20 11:59:18 +01:00
2023-12-03 07:33:02 +01:00
2023-11-20 11:59:26 +01:00
2024-02-23 09:24:47 +01:00
2024-02-05 20:14:32 +00:00
2023-09-05 10:13:45 -07:00
2023-10-13 17:27:27 -07:00
2023-12-20 17:01:51 +01:00
2024-02-16 19:10:42 +01:00
2023-12-03 07:33:04 +01:00
2023-08-03 16:59:40 -03:00
2024-02-23 09:25:00 +01:00
2024-02-23 09:25:14 +01:00
2024-02-23 09:25:14 +01:00
2023-10-16 05:32:23 -04:00
2023-08-07 15:57:25 -10:00