From: Alan T. DeKok Date: Sat, 23 Mar 2019 18:07:25 +0000 (-0400) Subject: verify edge order in compressed nodes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19971b3dadbc2b51b75ea7963f8138fd016b4b53;p=thirdparty%2Ffreeradius-server.git verify edge order in compressed nodes --- diff --git a/src/lib/util/trie.c b/src/lib/util/trie.c index 24a60096dfb..e1a1acd281d 100644 --- a/src/lib/util/trie.c +++ b/src/lib/util/trie.c @@ -2358,6 +2358,14 @@ static int fr_trie_comp_verify(fr_trie_t *trie) return -1; } + if ((i + 1) < comp->used) { + if (comp->index[i] >= comp->index[i + 1]) { + fr_strerror_printf("comp node has inverted edges at %d (%04x >= %04x)", + i, comp->index[i], comp->index[i + 1]); + return -1; + } + } + if (fr_trie_verify(comp->trie[i]) < 0) return -1; used++; }