Fix: Uninitialized ctf_stream_pos structure in ctf_float_write()
[babeltrace.git] / formats / ctf / types / float.c
index 2e0bd5ce57ea78b42994e13b4ddf05e19bc79ae5..689028360d4fe8f258d307e014e54103fb03201e 100644 (file)
@@ -197,7 +197,7 @@ int ctf_float_read(struct bt_stream_pos *ppos, struct bt_definition *definition)
        }
        tmpfloat = container_of(tmpdef, struct definition_float, p);
        memset(&destp, 0, sizeof(destp));
-       ctf_init_pos(&destp, -1, O_RDWR);
+       ctf_init_pos(&destp, NULL, -1, O_RDWR);
        mmap_align_set_addr(&mma, (char *) u.bits);
        destp.base_mma = &mma;
        destp.packet_size = sizeof(u) * CHAR_BIT;
@@ -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;
 
@@ -253,7 +253,7 @@ int ctf_float_write(struct bt_stream_pos *ppos, struct bt_definition *definition
                goto end;
        }
        tmpfloat = container_of(tmpdef, struct definition_float, p);
-       ctf_init_pos(&srcp, -1, O_RDONLY);
+       ctf_init_pos(&srcp, NULL, -1, O_RDONLY);
        mmap_align_set_addr(&mma, (char *) u.bits);
        srcp.base_mma = &mma;
        srcp.packet_size = sizeof(u) * CHAR_BIT;
This page took 0.022802 seconds and 4 git commands to generate.