mirror of
https://github.com/espressif/openthread.git
synced 2026-08-15 15:17:46 +00:00
[router-table] validate router id before allocating router (#2710)
Credit to OSS-Fuzz.
This commit is contained in:
@@ -241,7 +241,7 @@ Router *RouterTable::Allocate(uint8_t aRouterId)
|
||||
{
|
||||
Router *rval = NULL;
|
||||
|
||||
VerifyOrExit(!IsAllocated(aRouterId) && mRouterIdReuseDelay[aRouterId] == 0);
|
||||
VerifyOrExit(aRouterId <= Mle::kMaxRouterId && !IsAllocated(aRouterId) && mRouterIdReuseDelay[aRouterId] == 0);
|
||||
|
||||
mAllocatedRouterIds[aRouterId / 8] |= 1 << (aRouterId % 8);
|
||||
UpdateAllocation();
|
||||
|
||||
Reference in New Issue
Block a user