From c1954838b6fff4a0375f68483e283ab10e0a42bb Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Tue, 29 May 2018 09:45:44 -0700 Subject: [PATCH] [router-table] validate num routers when processing Route TLV (#2744) Credit to OSS-Fuzz. --- src/core/thread/router_table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/thread/router_table.cpp b/src/core/thread/router_table.cpp index b9bbc1386..2eb60eba7 100644 --- a/src/core/thread/router_table.cpp +++ b/src/core/thread/router_table.cpp @@ -115,7 +115,7 @@ void RouterTable::UpdateAllocation(void) // build index map for (uint8_t i = 0; i <= Mle::kMaxRouterId; i++) { - if (IsAllocated(i)) + if (IsAllocated(i) && mActiveRouterCount < Mle::kMaxRouters) { indexMap[i] = mActiveRouterCount++; }