]> git.lttng.org Git - lttng-tools.git/commit
Fix: lttng-ctl: Validate lttng_enable_event_with_exclusions inputs at beginning of...
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 26 Nov 2024 14:41:18 +0000 (14:41 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 Nov 2024 17:05:50 +0000 (17:05 +0000)
commit729414e5fbbf6716378eb4a8dbb7ea56f5327e9c
tree7fcb0a92a44ba6ebca4b0635584b49cdcc361200
parent26d98a2be1a0bbd28267781d36dda2a69dcfcd3d
Fix: lttng-ctl: Validate lttng_enable_event_with_exclusions inputs at beginning of function

Checking for ev == nullptr after having dereferenced ev triggers this
Coverity warning:

    CID 1566411:  Null pointer dereferences  (REVERSE_INULL)
    Null-checking "ev" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Move the handle and ev nullptr checks before the LTTNG_EVENT_ALL
special-case. This is relevant because within LTTNG_EVENT_ALL, after
modifying the event type, lttng_enable_event_with_exclusions is invoked
again with the modified type, which will end up doing the input
validation anyway.

Move the original_filter_expression before the LTTNG_EVENT_ALL event
type check for the same reason: it will end up being checked with the
modified event type in the nested call anyway, so favor early checking
of input arguments.

Change-Id: Id1c931300aa49477a9f480698f5dad645240b904
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/lttng-ctl.cpp
This page took 0.029752 seconds and 4 git commands to generate.