Skip to contentSkip to conversation

segtree: don't check for overlaps if set definition is empty

PATCH New Pablo Neira Ayuso 1 participant 1 message Jun 22, 2016 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 segtree: don't check for overlaps if set definition is empty

If the set comes without definition (ie. no elements) then skip check for overlaps since set->init is NULL.

---
 src/segtree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/segtree.c +1 -1
index 74f0fb3..fa11967 100644
@@ -377,7 +377,7 @@ static int set_to_segtree(struct list_head *msgs, struct set *set,
 	/* We are updating an existing set with new elements, check if the new
 	 * interval overlaps with any of the existing ones.
 	 */
-	if (add && set->init != init) {
+	if (add && set->init && set->init != init) {
 		err = set_overlap(msgs, set, init, tree->keylen);
 		if (err < 0)
 			return err;
Signature · 1 line
2.1.4