Avoid out-of-bounds read leading to runaway allocations. Fixes #2731

This commit is contained in:
dmiller 2023-10-30 19:01:07 +00:00
parent ff92f5bae9
commit ef71e5e37d

View file

@ -319,7 +319,7 @@ static void trie_split (struct trie_node *this, const u32 *addr, const u32 *mask
break;
}
}
if (new_mask[i] >= this->mask[i]) {
if (i >= 4 || new_mask[i] >= this->mask[i]) {
/* This node completely contains the new addr and mask. No need to split or add */
return;
}