lib: add null checks before "casting" to "base class"
With -fsanitize=undefined, I see:
/home/simark/src/babeltrace/src/lib/error.c:526:2: runtime error: member access within null pointer of type 'struct bt_error_cause_component_actor'
This is because doing `&cause->base` is undefined behavior if cause is
NULL. Add NULL checks around these expressions, when cause may be NULL.
Change-Id: Ie11273a24aa17a96bfccf10b121838e48c61984b
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/9584
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.025789 seconds and 4 git commands to generate.