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>