From a75b412ecfe3e3c286c57517b08171eb05fef0c4 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Thu, 5 Mar 2020 14:13:37 -0800 Subject: [PATCH] [settings] fix bootloop when more than 255 ChildInfo entries are stored (#4640) In MleRouter::RestoreChildren() there is an iteration over all ChildInfo items. This iterator uses mIndex which is uint8_t and in our case its value wraps causing infinite loop. Changing mIndex to uint16_t fixes this issue. --- src/core/common/settings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/common/settings.hpp b/src/core/common/settings.hpp index b881da3eb..97130f098 100644 --- a/src/core/common/settings.hpp +++ b/src/core/common/settings.hpp @@ -763,7 +763,7 @@ public: void Read(void); ChildInfo mChildInfo; - uint8_t mIndex; + uint16_t mIndex; bool mIsDone; };