Fix: relayd: Dereference before null check
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 4 Oct 2019 11:42:36 +0000 (07:42 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Oct 2019 17:30:35 +0000 (13:30 -0400)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/relayd/relayd.c

index 1ba0ccf99bdcb9586f8299e3295d43c3f75af13c..12f70f7e0bf8ad39dbcb5489b84fa953e3626bda 100644 (file)
@@ -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;
        }
This page took 0.026005 seconds and 4 git commands to generate.