From 919bd0236b6b419217e1ad969301bf6efa3d7f67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 15 Oct 2013 13:23:33 -0400 Subject: [PATCH] Fix: Uninitialized ctf_stream_pos structure in ctf_float_write() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Mathieu Desnoyers Signed-off-by: Mathieu Desnoyers --- 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 2daadf91..68902836 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; -- 2.34.1