Fix: lttng: add-trigger: erroneous null check on location return
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 Mar 2021 12:50:18 +0000 (07:50 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 5 Mar 2021 12:50:23 +0000 (07:50 -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)

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

src/bin/lttng/commands/add_trigger.c

index 0c714d84962bcaf0d9a1b697bba27de0fefa1dc4..83fd1c4473c437897cf95caf08a49c999cf951f7 100644 (file)
@@ -273,7 +273,7 @@ static int parse_kernel_probe_opts(const char *source,
 
                address = strtoul(s_hex, NULL, 0);
                *location = lttng_kernel_probe_location_address_create(address);
-               if (!location) {
+               if (!*location) {
                        ERR("Failed to create symbol kernel probe location.");
                        goto error;
                }
This page took 0.026152 seconds and 4 git commands to generate.