Fix: test content size vs headers len
[babeltrace.git] / formats / ctf / ctf.c
index bc3137c3128c001cad64090ea3bd82d76fca93df..20e849483d83cd4cc4d50ea66afb006e498245fb 100644 (file)
@@ -1569,6 +1569,11 @@ begin:
                return -EINVAL;
        }
 
+       if (packet_index.content_size < pos->offset) {
+               fprintf(stderr, "[error] Invalid CTF stream: content size is smaller than packet headers.\n");
+               return -EINVAL;
+       }
+
        if ((packet_index.packet_size >> LOG2_CHAR_BIT) == 0) {
                fprintf(stderr, "[error] Invalid CTF stream: packet size needs to be at least one byte\n");
                return -EINVAL;
This page took 0.023939 seconds and 4 git commands to generate.