Skip to content

Commit

Permalink
Add pointer sanity check before accessing ParticipantProxyData (#5440)
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL authored Dec 4, 2024
1 parent cbfb1e1 commit df80e44
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cpp/rtps/builtin/discovery/participant/PDPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,15 @@ void PDPClient::announceParticipantState(
if (getRTPSParticipant()->is_secure())
{
// Need the mangled guid prefix in this case
srv_guid_prefix = get_participant_proxy_data(svr.guidPrefix)->m_guid.guidPrefix;
auto pdata = get_participant_proxy_data(svr.guidPrefix);
if (nullptr != pdata)
{
srv_guid_prefix = pdata->m_guid.guidPrefix;
}
else
{
continue;
}
}
#endif // HAVE_SECURITY
locators.push_back(svr.metatrafficUnicastLocatorList);
Expand Down

0 comments on commit df80e44

Please sign in to comment.