From 455366c6664a9b2b7e9921f5332930d041e350c6 Mon Sep 17 00:00:00 2001 From: Tyler Hicks Date: Fri, 6 Feb 2015 19:20:05 -0600 Subject: [FIX FOR 08/13] fix: Use empty string for NULL bustypes when building queries Buses that don't specify a in their config can result in a NULL bustype pointer when AppArmor is building its query strings. This hits an assertion in _dbus_string_append(). However, it makes sense to represent NULL bustypes as an empty string. This means that AppArmor rules that specify a bus name will not work with buses that don't specify a in the bus config. Similarly, AppArmor rules that don't specify a bus name will work with buses that don't specify a in the bus config. Signed-off-by: Tyler Hicks --- bus/apparmor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bus/apparmor.c b/bus/apparmor.c index 6641663..7f8b512 100644 --- a/bus/apparmor.c +++ b/bus/apparmor.c @@ -282,7 +282,7 @@ build_common_query (DBusString *query, const char *con, const char *bustype) _dbus_string_append (query, con) && _dbus_string_append_byte (query, '\0') && _dbus_string_append_byte (query, AA_CLASS_DBUS) && - _dbus_string_append (query, bustype); + _dbus_string_append (query, bustype ? bustype : ""); } static dbus_bool_t -- 2.1.0