From bfe84bf251020efdabe15730f6377a66e2d79ff7 Mon Sep 17 00:00:00 2001 From: Brad House Date: Fri, 6 Oct 2023 08:08:22 -0400 Subject: [PATCH] fix slist search off by 1 --- src/lib/ares__slist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ares__slist.c b/src/lib/ares__slist.c index 0ece04bb..9974bc04 100644 --- a/src/lib/ares__slist.c +++ b/src/lib/ares__slist.c @@ -315,7 +315,7 @@ ares__slist_node_t *ares__slist_node_find(ares__slist_t *list, const void *val) /* Scan nodes starting at the highest level. For each level scan forward * until the value is between the prior and next node, or if equal quit * as we found a match */ - for (i=list->levels-1; i-- > 0; ) { + for (i=list->levels; i-- > 0; ) { if (node == NULL) node = list->head[i];