chiark / gitweb /
sd-bus: make sure %m resolves to the specified error in bus_error_set_errnofv()
[elogind.git] / src / libsystemd / sd-bus / bus-match.c
index 18afe0f12a0e96d585b8a29e81b3ff3a70cc01ec..0e92a85ef756fdaf177e8abdcf9c61394c5531dc 100644 (file)
@@ -537,7 +537,7 @@ static int bus_match_find_compare_value(
         else if (BUS_MATCH_CAN_HASH(t))
                 n = hashmap_get(c->compare.children, value_str);
         else {
-                for (n = c->child; !value_node_same(n, t, value_u8, value_str); n = n->next)
+                for (n = c->child; n && !value_node_same(n, t, value_u8, value_str); n = n->next)
                         ;
         }
 
@@ -748,6 +748,9 @@ int bus_match_parse(
                 bool escaped = false, quoted;
                 uint8_t u;
 
+                /* Avahi's match rules appear to include whitespace, skip over it */
+                p += strspn(p, " ");
+
                 eq = strchr(p, '=');
                 if (!eq)
                         return -EINVAL;