Fix: lttng: add-trigger: erroneous null check
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 26 Feb 2021 18:43:42 +0000 (13:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 4 Mar 2021 16:59:19 +0000 (11:59 -0500)
1447042 Dereference before null check

There may be a null pointer dereference, or else the comparison against null is unnecessary.

In parse_kernel_probe_opts: All paths that lead to this null pointer comparison already dereference the pointer earlier (CWE-476)

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I1b993de81fbbadea56f735045cf9d480d9e20294

src/bin/lttng/commands/add_trigger.c

index 401fa762ece18648ab2fedd2b0a43f92292ee9f5..9d013122d76a812038ef369798f289b6aebaf995 100644 (file)
@@ -252,7 +252,7 @@ static int parse_kernel_probe_opts(const char *source,
 
                        *location = lttng_kernel_probe_location_symbol_create(
                                        symbol_name, 0);
-                       if (!location) {
+                       if (!*location) {
                                ERR("Failed to create symbol kernel probe location.");
                                goto error;
                        }
This page took 0.041916 seconds and 4 git commands to generate.