Skip to content

Commit df80e44

Browse files
authored
Add pointer sanity check before accessing ParticipantProxyData (#5440)
Signed-off-by: Mario Dominguez <[email protected]>
1 parent cbfb1e1 commit df80e44

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,15 @@ void PDPClient::announceParticipantState(
774774
if (getRTPSParticipant()->is_secure())
775775
{
776776
// Need the mangled guid prefix in this case
777-
srv_guid_prefix = get_participant_proxy_data(svr.guidPrefix)->m_guid.guidPrefix;
777+
auto pdata = get_participant_proxy_data(svr.guidPrefix);
778+
if (nullptr != pdata)
779+
{
780+
srv_guid_prefix = pdata->m_guid.guidPrefix;
781+
}
782+
else
783+
{
784+
continue;
785+
}
778786
}
779787
#endif // HAVE_SECURITY
780788
locators.push_back(svr.metatrafficUnicastLocatorList);

0 commit comments

Comments
 (0)