From mboxrd@z Thu Jan 1 00:00:00 1970 From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers) Date: Mon, 28 Jan 2013 11:09:50 -0500 Subject: [lttng-dev] [PATCH babeltrace] Fix: Added a null pointer check to bt_ctf_field_name. In-Reply-To: <1359369367-12876-1-git-send-email-jeremie.galarneau@efficios.com> References: <1359369367-12876-1-git-send-email-jeremie.galarneau@efficios.com> Message-ID: <20130128160950.GA23309@Krystal> * J?r?mie Galarneau (jeremie.galarneau at efficios.com) wrote: > This function is called indirectly when calling __repr__ (print) in the python > bindings on the definition object returned by the get_top_level_scope method > thus resulting in a segmentation fault when the name attribute is not set. merged into master and python bindings branches, thanks! Mathieu > > Fixes #373 > > Signed-off-by: J?r?mie Galarneau > --- > formats/ctf/events.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/formats/ctf/events.c b/formats/ctf/events.c > index ac7dce4..182d0de 100644 > --- a/formats/ctf/events.c > +++ b/formats/ctf/events.c > @@ -168,7 +168,7 @@ const char *bt_ctf_event_name(const struct bt_ctf_event *ctf_event) > > const char *bt_ctf_field_name(const struct definition *def) > { > - if (!def) > + if (!def || !def->name) > return NULL; > > return rem_(g_quark_to_string(def->name)); > -- > 1.8.1.1 > > > _______________________________________________ > lttng-dev mailing list > lttng-dev at lists.lttng.org > http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com