From: Mathieu Desnoyers Date: Tue, 17 May 2016 14:44:25 +0000 (-0400) Subject: Fix: NULL pointer dereference in relay_index_get_by_id_or_create X-Git-Tag: v2.7.3~38 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8b20203296336afe30efd8aa04b6c18427641f9f;p=lttng-tools.git Fix: NULL pointer dereference in relay_index_get_by_id_or_create Found by Coverity: CID 1323134 (#1 of 1): Dereference after null check (FORWARD_NULL)34. var_deref_op: Dereferencing null pointer index. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/index.c b/src/bin/lttng-relayd/index.c index 5b5c711cb..84d4423d8 100644 --- a/src/bin/lttng-relayd/index.c +++ b/src/bin/lttng-relayd/index.c @@ -163,7 +163,7 @@ struct relay_index *relay_index_get_by_id_or_create(struct relay_stream *stream, end: rcu_read_unlock(); DBG2("Index %sfound or created in HT for stream ID %" PRIu64 " and seqnum %" PRIu64, - (index == NULL) ? "NOT " : "", index->stream->stream_handle, net_seq_num); + (index == NULL) ? "NOT " : "", stream->stream_handle, net_seq_num); return index; }