From 0f8dc59f57b4e9248d882bb6d890345605d2bafa Mon Sep 17 00:00:00 2001 From: rretanubun Date: Fri, 13 May 2022 15:57:32 -0400 Subject: [PATCH] [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. --- src/core/border_router/routing_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index ef1e1ccd5..d42648192 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -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(aBuffer);