Because the context parameter is dereferenced several times in related code without a null check,
we need to make sure to have a valid context.
Reported by Coverity: CID 54764: Dereference after null check (FORWARD_NULL)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
{
BusRegistry *registry;
+ _dbus_assert (context);
registry = dbus_new0 (BusRegistry, 1);
if (registry == NULL)
return NULL;
}
if (!bus_apparmor_allows_acquire_service (connection,
- (registry->context ?
- bus_context_get_type (registry->context) : NULL),
+ bus_context_get_type (registry->context),
_dbus_string_get_const_data (service_name), error))
goto out;