Peter Huewe
2012-04-24 21:19:39 UTC
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 <peterhuewe-***@public.gmane.org>
---
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 &&
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 <peterhuewe-***@public.gmane.org>
---
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
1.7.3.4