Messages in this thread Patch in this message | | | Date | Wed, 10 Jun 2009 01:42:15 -0400 | From | Steven Rostedt <> | Subject | [PATCH 09/11] tracing: check full name for field |
| |
From: Steven Rostedt <srostedt@redhat.com>
The check for print format fields only compared the name of the field up to the length of the field to look for. But it did not test if the field name itself matched but was larger. The wrong field could be found as a match.
ie. str could match str_arr.
[ Impact: fix the matching of fields ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org> --- kernel/trace/trace_read_binary.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_read_binary.c b/kernel/trace/trace_read_binary.c index 9ff4ed8..779de20 100644 --- a/kernel/trace/trace_read_binary.c +++ b/kernel/trace/trace_read_binary.c @@ -388,7 +388,8 @@ find_field(struct ftrace_event_call *call, const char *name, int len) struct ftrace_event_field *field; list_for_each_entry(field, &call->fields, link) { - if (!strncmp(field->name, name, len)) + if (!strncmp(field->name, name, len) && + !field->name[len]) return field; } -- 1.6.3.1 --
| |