If we e.g. pass pevent->last_event = NULL and pevent->nr_events = -1 to pevent_find_event_by_name we skip all the code and return event unitialized and set pevent->last_event to an arbitrary value, which obviously is a bad idea.
This patch fixes this by initalizing event with NULL Signed-off-by: Peter Huewe <peterhu...@gmx.de> --- pevent/parse-events.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pevent/parse-events.c b/pevent/parse-events.c index 58716e9..e1dde50 100644 --- a/pevent/parse-events.c +++ b/pevent/parse-events.c @@ -2917,7 +2917,7 @@ struct event_format * pevent_find_event_by_name(struct pevent *pevent, const char *sys, const char *name) { - struct event_format *event; + struct event_format *event = NULL; int i; if (pevent->last_event && -- 1.7.3.4 _______________________________________________ Power mailing list Power@bughost.org https://bughost.org/mailman/listinfo/power