Fix: test content size vs headers len
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 27 Nov 2013 09:50:54 +0000 (04:50 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 27 Nov 2013 09:50:54 +0000 (04:50 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 278956b85e32a253af7491c8528b85712e643119..794e428c51d069a97354826b17f0f391afbafcbf 100644 (file)
@@ -1572,6 +1572,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.025461 seconds and 4 git commands to generate.