X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;fp=formats%2Fctf%2Fctf.c;h=20e849483d83cd4cc4d50ea66afb006e498245fb;hp=bc3137c3128c001cad64090ea3bd82d76fca93df;hb=bf2c7f077c6c54fb8260b02ccc21a0dd8c688faa;hpb=9cb99902f59812e59dd1c2031763b50c5bebbb5f diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index bc3137c3..20e84948 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -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;