tools lib traceevent: Handle dynamic array's element size properly
authorJiri Olsa <jolsa@redhat.com>
Thu, 24 Jan 2013 20:46:43 +0000 (21:46 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 25 Jan 2013 15:49:28 +0000 (12:49 -0300)
commite23c1a5578cf32ed3a7ac9dde59a2de0a52ff812
treed58e6e41a4d8ff4f5e437225607e4fdb86cd12d3
parenta2d28d0c198b65fac28ea6212f5f8edc77b29c27
tools lib traceevent: Handle dynamic array's element size properly

Fixing the dynamic array format field parsing.

Currently the event_read_fields function could segfault while parsing
dynamic array other than string type. The reason is the event->pevent
does not need to be set and gets dereferenced unconditionaly.

Also adding proper initialization of field->elementsize based on the
parsed dynamic type.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1359060403-32422-1-git-send-email-jolsa@redhat.com
[ committer note: Made a char pointer parameter const, as requested by Steven ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/traceevent/event-parse.c