From dae407df004b28e360bd9fb52590063652b29811 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Fri, 7 Feb 2014 11:12:58 -0500 Subject: [PATCH] Fix: import index containing only a header MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If the index file is present, we have to make sure we imported at least one index before using the stream_class. Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- formats/ctf/ctf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index 122b708f..afc2aefa 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -1886,6 +1886,12 @@ int import_stream_packet_index(struct ctf_trace *td, g_array_append_val(file_stream->pos.packet_cycles_index, index); } + /* Index containing only the header. */ + if (!file_stream->parent.stream_class) { + ret = -1; + goto error; + } + ret = 0; error: -- 2.34.1