From: Arran Cudbard-Bell Date: Sat, 19 Oct 2019 16:51:49 +0000 (-0400) Subject: Fix logic bug in table_sorted_value_by_longest_prefix which sent the search in the... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bbea2f47afa7b102fe2e4ecbaceee69e26f30ac;p=thirdparty%2Ffreeradius-server.git Fix logic bug in table_sorted_value_by_longest_prefix which sent the search in the wrong direction if needle was a substring of a haystack entry --- diff --git a/src/lib/util/table.c b/src/lib/util/table.c index be34732e520..56d3c734872 100644 --- a/src/lib/util/table.c +++ b/src/lib/util/table.c @@ -340,6 +340,8 @@ static void const *table_sorted_value_by_longest_prefix(size_t *match_len, found = offset; if (match_len) *match_len = tlen; ret = 1; + } else { + ret = -1; } }