segtree: don't check for overlaps if set definition is empty
Pablo Neira Ayuso
maintainerPATCH 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.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/segtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/segtree.c +1 -1
@@ -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