]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix another overflow
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 29 Oct 2021 03:56:16 +0000 (23:56 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 29 Oct 2021 03:56:16 +0000 (23:56 -0400)
src/lib/util/table.c

index 3b25cba85c76434e2ee39a98261c40942387431b..ba32bad614b06f0ed3f3125de7f1579d46bdac29 100644 (file)
@@ -406,7 +406,7 @@ static void const *table_ordered_value_by_longest_prefix(size_t *match_len,
 
                offset = TABLE_IDX(table, i, element_size);
 
-               for (j = 0; (j < (size_t)name_len) && (name[j] == (ELEM_STR(offset))[j]); j++);
+               for (j = 0; (j < (size_t)name_len) && (j < ELEM_LEN(offset)) && (name[j] == (ELEM_STR(offset))[j]); j++);
 
                /*
                 *      If we didn't get to the end of the