Check for files not containing any header
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 26 May 2011 00:20:50 +0000 (20:20 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 26 May 2011 00:20:50 +0000 (20:20 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 2048d6a0f2de776a8e440233e8e514ed039c472a..adff1eb7ce86cd0a1e158fd49777175f454d3633 100644 (file)
@@ -784,6 +784,9 @@ int create_stream_packet_index(struct ctf_trace *td,
        if (ret < 0)
                return ret;
 
        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;
 
        for (pos->mmap_offset = 0; pos->mmap_offset < filestats.st_size; ) {
                uint64_t stream_id = 0;
 
This page took 0.025196 seconds and 4 git commands to generate.