From f6e30a8ad86ac3275c23a7dc7ee223c665b10c97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 9 Mar 2021 16:21:11 -0500 Subject: [PATCH] Fix: lttng: add-trigger: erroneous null check on location return MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ifcaf1b1854ea7177084ef5433f5a1b386381676a --- src/bin/lttng/commands/add_trigger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index 19a1c59e7..e4342cf85 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -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; } -- 2.34.1