diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index dfd0cfc5799612..0f557f175dd616 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -601,6 +601,7 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade PayloadHeader payloadHeader; SessionMessageDelegate::DuplicateMessage isDuplicate = SessionMessageDelegate::DuplicateMessage::No; Credentials::GroupDataProvider * groups = Credentials::GetGroupDataProvider(); + GroupId groupId; VerifyOrReturn(nullptr != groups); if (!packetHeader.GetDestinationGroupId().HasValue()) @@ -608,6 +609,8 @@ void SessionManager::SecureGroupMessageDispatch(const PacketHeader & packetHeade return; // malformed packet } + groupId = packetHeader.GetDestinationGroupId().Value(); + if (msg.IsNull()) { ChipLogError(Inet, "Secure transport received Groupcast NULL packet, discarding");