From: Sebastian Harl Date: Sun, 8 Mar 2015 21:56:09 +0000 (+0100) Subject: store: When advancing an iterator don't loop endlessly on filtered objects. X-Git-Tag: sysdb-0.8.0~129 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c8e0411a224f983df7a52068481ba26d0c84156f;p=sysdb.git store: When advancing an iterator don't loop endlessly on filtered objects. --- diff --git a/src/core/store_expr.c b/src/core/store_expr.c index ddaeccd..d9f6e04 100644 --- a/src/core/store_expr.c +++ b/src/core/store_expr.c @@ -417,10 +417,13 @@ sdb_store_expr_iter_get_next(sdb_store_expr_iter_t *iter) } /* Skip over any filtered objects */ - if (iter->filter) - while ((child = STORE_OBJ(sdb_avltree_iter_peek_next(iter->tree)))) + if (iter->filter) { + while ((child = STORE_OBJ(sdb_avltree_iter_peek_next(iter->tree)))) { if (sdb_store_matcher_matches(iter->filter, child, NULL)) break; + (void)sdb_avltree_iter_get_next(iter->tree); + } + } return ret; }