Code

store_lookup: Fix matching of services with empty attr matcher.
authorSebastian Harl <sh@tokkee.org>
Fri, 21 Feb 2014 02:16:27 +0000 (03:16 +0100)
committerSebastian Harl <sh@tokkee.org>
Fri, 21 Feb 2014 02:16:27 +0000 (03:16 +0100)
src/core/store_lookup.c

index 26e466617dc29244da13a770dcc465554b5b68fd..e0eedf00dc181587a97684f42ebaf35248f2f47c 100644 (file)
@@ -166,6 +166,9 @@ match_service(service_matcher_t *m, sdb_store_base_t *obj)
        if (obj->type != SDB_SERVICE)
                return -1;
 
+       if (! m->attr)
+               return 0;
+
        iter = sdb_llist_get_iter(SDB_STORE_OBJ(obj)->attributes);
        while (sdb_llist_iter_has_next(iter)) {
                sdb_store_base_t *attr = STORE_BASE(sdb_llist_iter_get_next(iter));