Fix: add missing header size validation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 27 Oct 2012 15:08:07 +0000 (11:08 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 27 Oct 2012 15:08:07 +0000 (11:08 -0400)
Was causing infinite loop for
tests/ctf-traces/fail/lttng-modules-2.0-pre1 failure test.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index 8029512a2745876f9ce19e9ce1fab725fb64ddf7..46f009d24faebe948835ebae533ef441b3408c39 100644 (file)
@@ -902,6 +902,9 @@ int ctf_open_trace_metadata_packet_read(struct ctf_trace *td, FILE *in,
                        return -EINVAL;
        }
 
+       if ((header.content_size / CHAR_BIT) < header_sizeof(header))
+               return -EINVAL;
+
        toread = (header.content_size / CHAR_BIT) - header_sizeof(header);
 
        for (;;) {
This page took 0.033785 seconds and 4 git commands to generate.