policy: bugfix -> get const data instead non-const 07/244107/1
authorAdrian Szyndela <adrian.s@samsung.com>
Mon, 14 Sep 2020 11:04:25 +0000 (13:04 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Tue, 15 Sep 2020 06:02:31 +0000 (08:02 +0200)
Get const data instead of non-const data for constant strings.
It triggered asserts when they are enabled, although the underlying
production code is the same.

Change-Id: Ic7102b6601ca168e6bf5f6902988a06c6ab76f03

bus/policy.c

index 53a6682..cbb66b9 100644 (file)
@@ -1350,7 +1350,7 @@ find_and_check_rules (DBusHashTable *rules,
         }
     }
   else
-    score = find_and_check_rules_for_name (rules, _dbus_string_get_data(p->u.name),
+    score = find_and_check_rules_for_name (rules, _dbus_string_get_const_data(p->u.name),
                                            score, check_func, params,
                                            toggles, log, result,
                                            privilege, matched_rule);