From: Mathieu Desnoyers Date: Wed, 26 Sep 2012 02:10:06 +0000 (-0400) Subject: Fix relayd: NULL ptr deref X-Git-Tag: v2.1.0-rc4~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=438b505e46c9cafce645b6ff88a03072174184e8;p=lttng-tools.git Fix relayd: NULL ptr deref Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 15e2b2266..d01491e9c 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1267,7 +1267,7 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr, { int ret = htobe32(LTTNG_OK); struct lttcomm_relayd_version reply; - struct relay_session *session = NULL; + struct relay_session *session; if (cmd->session == NULL) { session = zmalloc(sizeof(struct relay_session)); @@ -1279,6 +1279,8 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr, session->id = ++last_relay_session_id; DBG("Created session %" PRIu64, session->id); cmd->session = session; + } else { + session = cmd->session; } session->version_check_done = 1;