Fix: src.ctf.fs: Using uninitialized value
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 6 May 2019 18:21:55 +0000 (14:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 8 May 2019 18:09:08 +0000 (14:09 -0400)
`iter_status` may be used uninitialized if the break statement in the
do-while is reached.

Fixes Coverity #1401236:
  CID 1401236 (#1 of 1): Uninitialized scalar variable (UNINIT)
  9. uninit_use: Using uninitialized value iter_status.

Reported-by: Coverity (1401236) Uninitialized scalar variable
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I96e4608011144cb3c1ae26018d57e98f0358a779
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1261
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs-src/data-stream-file.c

index fab87deeac56787ad658107e3b44fd44854216b8..924c579f5227b38b3105235a29fc9f95f9d2c94b 100644 (file)
@@ -536,7 +536,7 @@ struct ctf_fs_ds_index *build_index_from_stream_file(
 {
        int ret;
        struct ctf_fs_ds_index *index = NULL;
-       enum bt_msg_iter_status iter_status;
+       enum bt_msg_iter_status iter_status = BT_MSG_ITER_STATUS_OK;
        off_t current_packet_offset_bytes = 0;
 
        BT_LOGD("Indexing stream file %s", ds_file->file->path->str);
This page took 0.02605 seconds and 4 git commands to generate.