From bba2d65fecae3b32cd02612d900980e406d566da Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 14:51:15 -0400 Subject: [PATCH] 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 --- src/bin/lttng-sessiond/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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 */ -- 2.34.1