Skip to content

Commit b1e0ff7

Browse files
ivpravdinrostedt
authored andcommitted
rtla: Fix buffer overflow in actions_parse
Currently, tests 3 and 13-22 in tests/timerlat.t fail with error: *** buffer overflow detected ***: terminated timeout: the monitored command dumped core The result of running `sudo make check` is tests/timerlat.t (Wstat: 0 Tests: 22 Failed: 11) Failed tests: 3, 13-22 Files=3, Tests=34, 140 wallclock secs ( 0.07 usr 0.01 sys + 27.63 cusr 27.96 csys = 55.67 CPU) Result: FAIL Fix buffer overflow in actions_parse to avoid this error. After this change, the tests results are tests/hwnoise.t ... ok tests/osnoise.t ... ok tests/timerlat.t .. ok All tests successful. Files=3, Tests=34, 186 wallclock secs ( 0.06 usr 0.01 sys + 41.10 cusr 44.38 csys = 85.55 CPU) Result: PASS Link: https://lore.kernel.org/164ffc2ec8edacaf1295789dad82a07817b6263d.1757034919.git.ipravdin.official@gmail.com Fixes: 6ea082b ("rtla/timerlat: Add action on threshold feature") Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com> Reviewed-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 76eeb9b commit b1e0ff7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/tracing/rtla/src/actions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ actions_parse(struct actions *self, const char *trigger)
131131
{
132132
enum action_type type = ACTION_NONE;
133133
char *token;
134-
char trigger_c[strlen(trigger)];
134+
char trigger_c[strlen(trigger) + 1];
135135

136136
/* For ACTION_SIGNAL */
137137
int signal = 0, pid = 0;

0 commit comments

Comments
 (0)