Fix: source.ctf.fs: 0-length packet index length causes SIGFPE
A corrupted index can present a 0-length packet index length
which will result in a division by 0 when computing the index
entry count.
Program terminated with signal SIGFPE, Arithmetic exception.
#0 0x00007f6ecbd44978 in build_index_from_idx_file (ds_file=0x561ade51ca00, file_info=0x561ade51d000,
msg_iter=0x561ade51cd00) at data-stream-file.c:640
640 file_entry_count = (filesize - sizeof(*header)) / file_index_entry_size;
The index packet length is checked against the smallest valid size:
the size of an index entry as of the 1.0 CTF index version.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I83c705575d55f3b56ae413d1ce5ae0fc60121f2c
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3606
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.026302 seconds and 4 git commands to generate.