From 8895362d406b7e7752aed90dcdfa3903910cbbbd Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 25 May 2011 20:20:50 -0400 Subject: [PATCH] Check for files not containing any header Signed-off-by: Mathieu Desnoyers --- formats/ctf/ctf.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.34.1