From: Jérémie Galarneau Date: Fri, 5 Mar 2021 12:50:18 +0000 (-0500) Subject: Fix: lttng: add-trigger: erroneous null check on location return X-Git-Tag: v2.13.0-rc1~275 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5c6ca80951867d21c8a91b36560f0e18e4d2f232;p=lttng-tools.git Fix: lttng: add-trigger: erroneous null check on location return 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 Change-Id: I8202319d7f664bc20b2d6444ad296c03ed7dd628 --- diff --git a/src/bin/lttng/commands/add_trigger.c b/src/bin/lttng/commands/add_trigger.c index 0c714d849..83fd1c447 100644 --- a/src/bin/lttng/commands/add_trigger.c +++ b/src/bin/lttng/commands/add_trigger.c @@ -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; }