Skip to content

Commit 51a24b7

Browse files
committed
Merge tag 'trace-tools-v6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull rtla tool fixes from Steven Rostedt: - Fix a buffer overflow in actions_parse() The "trigger_c" variable did not account for the nul byte when determining its size - Fix a compare that had the values reversed actions_destroy() is supposed to reallocate when len is greater than the current size, but the compare was testing if size is greater than the new length * tag 'trace-tools-v6.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: rtla/actions: Fix condition for buffer reallocation rtla: Fix buffer overflow in actions_parse
2 parents fec734e + 2227f27 commit 51a24b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/tracing/rtla/src/actions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ actions_destroy(struct actions *self)
4949
static struct action *
5050
actions_new(struct actions *self)
5151
{
52-
if (self->size >= self->len) {
52+
if (self->len >= self->size) {
5353
self->size *= 2;
5454
self->list = realloc(self->list, self->size * sizeof(struct action));
5555
}
@@ -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)