[routing-manager] use sizeof explicit type Ip6::Icmp::Header (#7693)

While using sizeof(*icmp6Header) before it is initialized to something
is not wrong, it is possible this will be flagged by some code checker
tools. Lets check using direct type.
This commit is contained in:
rretanubun
2022-05-13 12:57:32 -07:00
committed by GitHub
parent 658491a1aa
commit 0f8dc59f57
+1 -1
View File
@@ -340,7 +340,7 @@ void RoutingManager::RecvIcmp6Message(uint32_t aInfraIfIndex,
VerifyOrExit(IsInitialized() && mIsRunning, error = kErrorDrop);
VerifyOrExit(aInfraIfIndex == mInfraIfIndex, error = kErrorDrop);
VerifyOrExit(aBuffer != nullptr && aBufferLength >= sizeof(*icmp6Header), error = kErrorParse);
VerifyOrExit(aBuffer != nullptr && aBufferLength >= sizeof(Ip6::Icmp::Header), error = kErrorParse);
icmp6Header = reinterpret_cast<const Ip6::Icmp::Header *>(aBuffer);