`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>
{
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);