From be28486fb7da679cce4bb5f9e7a472fad618b612 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 7 Nov 2019 13:35:08 -0800 Subject: [PATCH] [network-data] fix how the OnMeshPrefixConfig structs are compared (#4312) This commit ensures the entire struct size is used when comparing two `OnMeshPrefixConfig` (`otBorderRouterConfig`) instances from `NetworkData::ContainsOnMeshPrefixes()` method. --- src/core/thread/network_data.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/thread/network_data.cpp b/src/core/thread/network_data.cpp index 57b1b9fa4..69c7d7b96 100644 --- a/src/core/thread/network_data.cpp +++ b/src/core/thread/network_data.cpp @@ -386,7 +386,7 @@ bool NetworkData::ContainsOnMeshPrefixes(NetworkData &aCompare, uint16_t aRloc16 while ((error = GetNextOnMeshPrefix(innerIterator, aRloc16, innerConfig)) == OT_ERROR_NONE) { - if (memcmp(&outerConfig, &innerConfig, (sizeof(outerConfig) - sizeof(outerConfig.mRloc16))) == 0) + if (memcmp(&outerConfig, &innerConfig, sizeof(outerConfig)) == 0) { break; }