From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 18:51:15 +0000 (-0400) Subject: Fix: comparing array against NULL X-Git-Tag: v2.2.0-rc3~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bba2d65fecae3b32cd02612d900980e406d566da;p=lttng-tools.git Fix: comparing array against NULL 1019939 Array compared against 0 In process_client_msg: Array compared against NULL pointer (CWE-398) Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 746f21e45..55751e85b 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2562,12 +2562,7 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock, session_lock_list(); cmd_ctx->session = session_find_by_name(cmd_ctx->lsm->session.name); if (cmd_ctx->session == NULL) { - if (cmd_ctx->lsm->session.name != NULL) { - ret = LTTNG_ERR_SESS_NOT_FOUND; - } else { - /* If no session name specified */ - ret = LTTNG_ERR_SELECT_SESS; - } + ret = LTTNG_ERR_SESS_NOT_FOUND; goto error; } else { /* Acquire lock for the session */