Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH babeltrace] Fix: Added a null pointer check to bt_ctf_field_name.
@ 2013-01-28 10:36 Jérémie Galarneau
  2013-01-28 16:09 ` Mathieu Desnoyers
  0 siblings, 1 reply; 2+ messages in thread
From: Jérémie Galarneau @ 2013-01-28 10:36 UTC (permalink / raw)


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.

Fixes #373

Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-28 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28 10:36 [lttng-dev] [PATCH babeltrace] Fix: Added a null pointer check to bt_ctf_field_name Jérémie Galarneau
2013-01-28 16:09 ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox