[meshcop] check channel page value in ChannelTlv::IsValid() (#6667)

This commit is contained in:
Jonathan Hui
2021-05-25 16:53:17 -07:00
committed by GitHub
parent 5cd088cd76
commit e503c949b9
+1
View File
@@ -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;