X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Findex%2Findex.c;h=b481badb1d6556e2f6f1807264d33e81e6be41b2;hp=b5591d137c923a97617005f9a85145e09264cba4;hb=a3461e94de72e04fd6040c0fad5fb6d3615a2de4;hpb=1b47ae5812ca04726890048e7ec9ce4186e4d590 diff --git a/src/common/index/index.c b/src/common/index/index.c index b5591d137..b481badb1 100644 --- a/src/common/index/index.c +++ b/src/common/index/index.c @@ -245,6 +245,10 @@ struct lttng_index_file *lttng_index_file_open(const char *path_name, ERR("Invalid header version"); goto error_close; } + if (element_len > sizeof(struct ctf_packet_index)) { + ERR("Index element length too long"); + goto error_close; + } index_file->fd = read_fd; index_file->major = major;