From: Jérémie Galarneau Date: Fri, 26 Feb 2021 18:43:42 +0000 (-0500) Subject: Fix: lttng: add-trigger: erroneous null check X-Git-Tag: v2.13.0-rc1~309 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=14f27f798c912b58dca37abe8523b3cffd0d17b4;p=lttng-tools.git Fix: lttng: add-trigger: erroneous null check 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: I1b993de81fbbadea56f735045cf9d480d9e20294 --- diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index 401fa762e..9d013122d 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -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; }