From: Julien Desfossez Date: Fri, 7 Feb 2014 16:12:58 +0000 (-0500) Subject: Fix: import index containing only a header X-Git-Tag: v1.2.0-rc1~14 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=dae407df004b28e360bd9fb52590063652b29811 Fix: import index containing only a header 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 --- 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: