Fix: lttng: add-trigger: erroneous null check on location return
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 9 Mar 2021 21:21:11 +0000 (16:21 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 9 Mar 2021 21:21:14 +0000 (16:21 -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: Ifcaf1b1854ea7177084ef5433f5a1b386381676a

src/bin/lttng/commands/add_trigger.c

index 19a1c59e76e80a960f95d8223711a91465206aa9..e4342cf85d99a7dfb149f85c702bd57cf99e7bfd 100644 (file)
@@ -237,7 +237,7 @@ static int parse_kernel_probe_opts(const char *source,
 
                *location = lttng_kernel_probe_location_symbol_create(
                                symbol_name, offset);
-               if (!location) {
+               if (!*location) {
                        ERR("Failed to create symbol kernel probe location.");
                        goto error;
                }
This page took 0.027274 seconds and 4 git commands to generate.