From: Francis Deslauriers Date: Fri, 4 Oct 2019 11:42:36 +0000 (-0400) Subject: Fix: relayd: Dereference before null check X-Git-Tag: v2.12.0-rc1~325 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=36f9f13bca63cdc94fcc12f03d9c3e181afc81a5;p=lttng-tools.git Fix: relayd: Dereference before null check Coverity report: CID 1405858 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking base_path suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Reported-by: Coverity (1405858) Dereference before null check Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/relayd/relayd.c b/src/common/relayd/relayd.c index 1ba0ccf99..12f70f7e0 100644 --- a/src/common/relayd/relayd.c +++ b/src/common/relayd/relayd.c @@ -191,7 +191,7 @@ static int relayd_create_session_2_11(struct lttcomm_relayd_sock *rsock, goto error; } dst += hostname_len; - if (base_path && lttng_strncpy(dst, base_path, base_path_len)) { + if (lttng_strncpy(dst, base_path, base_path_len)) { ret = -1; goto error; }