mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 02:00:12 +00:00
[meshcop] check channel page value in ChannelTlv::IsValid() (#6667)
This commit is contained in:
@@ -173,6 +173,7 @@ bool ChannelTlv::IsValid(void) const
|
||||
bool ret = false;
|
||||
|
||||
VerifyOrExit(GetLength() == sizeof(*this) - sizeof(Tlv));
|
||||
VerifyOrExit(mChannelPage < sizeof(uint32_t) * CHAR_BIT);
|
||||
VerifyOrExit((1U << mChannelPage) & Radio::kSupportedChannelPages);
|
||||
VerifyOrExit(Radio::kChannelMin <= GetChannel() && GetChannel() <= Radio::kChannelMax);
|
||||
ret = true;
|
||||
|
||||
Reference in New Issue
Block a user