X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=adff1eb7ce86cd0a1e158fd49777175f454d3633;hb=a10a7e5ba860f8294c3248b9951f50b5737ac7df;hp=2048d6a0f2de776a8e440233e8e514ed039c472a;hpb=75cc2c3593a5cec870fb530ed4712b5c13d9f0db;p=babeltrace.git diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 2048d6a0..adff1eb7 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -784,6 +784,9 @@ int create_stream_packet_index(struct ctf_trace *td, if (ret < 0) return ret; + if (filestats.st_size < MAX_PACKET_HEADER_LEN / CHAR_BIT) + return -EINVAL; + for (pos->mmap_offset = 0; pos->mmap_offset < filestats.st_size; ) { uint64_t stream_id = 0;