aboutsummaryrefslogtreecommitdiffstats
path: root/parse-events.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-06-17 15:36:09 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-06-17 15:36:09 -0400
commit11b828a7f5759ee6de214a102ee97d7b712bb47e (patch)
tree1ae7255b27e3e700f60c27e03a800517cd031ce1 /parse-events.c
parent9e0d4a86a85734a3da18d9edf44249b03988cddd (diff)
trace-cmd: Use correct size for rest of record
When the field does not have a lenth, use rest of the data item. But account for the offset of the field. Field arrays with [0] denote to use the rest of the record. But the size set was the size of the record and not the size starting from the field to the end of the record. This was causing SEGFAULTS when the record was at the end of a page, and the copy was going beyond the page. Reported-by: Will Schmidt <will_schmidt@vnet.ibm.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'parse-events.c')
-rw-r--r--parse-events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse-events.c b/parse-events.c
index 5503a18..13c41aa 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -3066,7 +3066,7 @@ static void print_str_arg(struct trace_seq *s, void *data, int size,
3066 die("field %s not found", arg->field.name); 3066 die("field %s not found", arg->field.name);
3067 } 3067 }
3068 /* Zero sized fields, mean the rest of the data */ 3068 /* Zero sized fields, mean the rest of the data */
3069 len = arg->field.field->size ? : size; 3069 len = arg->field.field->size ? : size - arg->field.field->offset;
3070 3070
3071 /* 3071 /*
3072 * Some events pass in pointers. If this is not an array 3072 * Some events pass in pointers. If this is not an array