aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-05-14 23:07:56 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-05-14 23:55:12 -0400
commit5872144f64b34a5942f6b4acedc90b02de72c58b (patch)
tree65ab10576155c05d7ac319197896a31721f61499
parent8cd995b6deedf98b7694ed32a786ee7f793d1eec (diff)
tracing/filters: fix off-by-one bug
We should leave the last slot for the ending '\0'. [ Impact: fix possible crash when the length of an operand is 128 ] Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> LKML-Reference: <4A0CDC8C.30602@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel/trace/trace_events_filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 22c29984fe0e..a7430b16d243 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -736,7 +736,7 @@ static inline void clear_operand_string(struct filter_parse_state *ps)
736 736
737static inline int append_operand_char(struct filter_parse_state *ps, char c) 737static inline int append_operand_char(struct filter_parse_state *ps, char c)
738{ 738{
739 if (ps->operand.tail == MAX_FILTER_STR_VAL) 739 if (ps->operand.tail == MAX_FILTER_STR_VAL - 1)
740 return -EINVAL; 740 return -EINVAL;
741 741
742 ps->operand.string[ps->operand.tail++] = c; 742 ps->operand.string[ps->operand.tail++] = c;