aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-09-23 12:30:14 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-10-18 18:32:48 -0400
commit7190a0111b4c7e2e767915a8830a197282a9f9d5 (patch)
treedca2f9eacc3506d221d3457af3f078222b9e9c05
parentfda4ad94ec6bab5d825581caaa2705f924eac1c0 (diff)
downloadlibtraceevent-7190a0111b4c7e2e767915a8830a197282a9f9d5.tar.gz
libtraceevent: Fix uninitialized variable in eval_num_arg()
It appears that my compiler version did not notice that "field_size" passed to check_data_offset_size() in the TEP_PRINT_DYNAMIC_ARRAY case was not initialized. But other compilers do. Since this case we just want to make sure the offset is not passed the end of the event data, we can simply pass in zero. Link: https://lore.kernel.org/linux-trace-devel/20220923123014.489e0e39@gandalf.local.home Fixes: efd32896dd5db ("libtraceevent: Add warnings if fields are outside the event") Reported-by: Ross Zwisler <zwisler@google.com> Reviewed-by: Ross Zwisler <zwisler@google.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--src/event-parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event-parse.c b/src/event-parse.c
index 980e980..a0458e5 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -4310,7 +4310,7 @@ eval_num_arg(void *data, int size, struct tep_event *event, struct tep_print_arg
dynamic_offset_field(tep, arg->dynarray.field, data, size,
&offset, NULL);
if (check_data_offset_size(event, arg->field.name, size,
- offset, field_size)) {
+ offset, 0)) {
val = (unsigned long)data;
break;
}