X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=46f009d24faebe948835ebae533ef441b3408c39;hb=b1ccd079a50e815eb1045ad80e4ab3400cfdc356;hp=8029512a2745876f9ce19e9ce1fab725fb64ddf7;hpb=209fa29602376e7d0de16f3a6f6dd3caf8af84b5;p=babeltrace.git diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 8029512a..46f009d2 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -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 (;;) {