Fix: ensure mmap_base_offset is zeroed on initialization
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 20 Aug 2012 20:09:25 +0000 (16:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 20 Aug 2012 20:09:25 +0000 (16:09 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c
formats/ctf/types/float.c

index 272e8c45f4a6dc22270e6e7286bc64b723f448be..a2403a77ab8d8906e18e59cb41d6a68684e2ba7a 100644 (file)
@@ -551,15 +551,6 @@ error:
 void ctf_init_pos(struct ctf_stream_pos *pos, int fd, int open_flags)
 {
        pos->fd = fd;
-       pos->mmap_offset = 0;
-       pos->packet_size = 0;
-       pos->content_size = 0;
-       pos->content_size_loc = NULL;
-       pos->base_mma = NULL;
-       pos->offset = 0;
-       pos->dummy = false;
-       pos->cur_index = 0;
-       pos->packet_real_index = NULL;
        if (fd >= 0) {
                pos->packet_cycles_index = g_array_new(FALSE, TRUE,
                                                sizeof(struct packet_index));
index 7a7c323afc674bf689596b95a28fd5f7a76a01ad..9ad4e602f0df705276ee45bbf92cfe7b154e921e 100644 (file)
@@ -163,6 +163,7 @@ int ctf_float_read(struct stream_pos *ppos, struct definition *definition)
                return -EINVAL;
        }
        tmpfloat = container_of(tmpdef, struct definition_float, p);
+       memset(&destp, 0, sizeof(destp));
        ctf_init_pos(&destp, -1, O_RDWR);
        mmap_align_set_addr(&mma, (char *) u.bits);
        destp.base_mma = &mma;
This page took 0.033412 seconds and 4 git commands to generate.