aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2009-12-21 18:54:01 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-21 18:54:01 -0500
commit50486581f93e196770d3ebbb5a5ed4a9d52d144b (patch)
treebc112aaf2dfd2f7a1ac248bbad5e45dc2b784d8a
parentb05f27dc7d0dab346e20795ce4d9f6d56d3e18ea (diff)
trace-cmd: Zero out item_arg in process_paran
The print arg gets its fields processed the first time they are used. If the field is not initialized to zero, this will cause it to use an uninitialized field and crash. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--parse-events.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse-events.c b/parse-events.c
index 24ecb85..eabce41 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -1998,6 +1998,7 @@ process_paren(struct event_format *event, struct print_arg *arg, char **tok)
1998 die("previous needed to be PRINT_ATOM"); 1998 die("previous needed to be PRINT_ATOM");
1999 1999
2000 item_arg = malloc_or_die(sizeof(*item_arg)); 2000 item_arg = malloc_or_die(sizeof(*item_arg));
2001 memset(item_arg, 0, sizeof(*item_arg));
2001 2002
2002 arg->type = PRINT_TYPE; 2003 arg->type = PRINT_TYPE;
2003 arg->typecast.type = arg->atom.atom; 2004 arg->typecast.type = arg->atom.atom;