[lttng-dev] [PATCH babeltrace] Fix: Uninitialized ctf_stream_pos structure in ctf_float_write()

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue Oct 15 13:23:33 EDT 2013


This structure is passed to _ctf_float_copy() which uses the
uninitialized mmap_offset and offset values to read the source
floating point value.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 formats/ctf/types/float.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/formats/ctf/types/float.c b/formats/ctf/types/float.c
index 2daadf9..6890283 100644
--- a/formats/ctf/types/float.c
+++ b/formats/ctf/types/float.c
@@ -232,7 +232,7 @@ int ctf_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition
 	union doubleIEEE754 u;
 	struct bt_definition *tmpdef;
 	struct definition_float *tmpfloat;
-	struct ctf_stream_pos srcp;
+	struct ctf_stream_pos srcp = { { 0 } };
 	struct mmap_align mma;
 	int ret;
 
-- 
1.8.4




More information about the lttng-dev mailing list