lkml.org 
[lkml]   [2009]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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
--


\
 
 \ /
  Last update: 2009-06-10 07:47    [W:0.102 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site