From 9a8db1f6b4a200391cd3fe26c19e2e27b11db10c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Thu, 21 May 2026 07:27:09 +0200 Subject: [PATCH] Fix dereference error of 'shared_secret_handle' (#6404) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Carlos Ferreira González (cherry picked from commit f59b2c282858ac767f5a259f1dd212f7105dd91a) --- src/cpp/rtps/security/SecurityManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/rtps/security/SecurityManager.cpp b/src/cpp/rtps/security/SecurityManager.cpp index cfec658ebcd..0d59c1e278d 100644 --- a/src/cpp/rtps/security/SecurityManager.cpp +++ b/src/cpp/rtps/security/SecurityManager.cpp @@ -2970,7 +2970,7 @@ bool SecurityManager::discovered_reader( if (local_writer != writer_handles_.end()) { - if (remote_participant_crypto_handle != nullptr) + if (remote_participant_crypto_handle != nullptr && shared_secret_handle != nullptr) { DatareaderCryptoHandle* remote_reader_handle = crypto_plugin_->cryptokeyfactory()->register_matched_remote_datareader( @@ -3328,7 +3328,7 @@ bool SecurityManager::discovered_writer( if (local_reader != reader_handles_.end()) { - if (remote_participant_crypto_handle != nullptr) + if (remote_participant_crypto_handle != nullptr && shared_secret_handle != nullptr) { DatawriterCryptoHandle* remote_writer_handle = crypto_plugin_->cryptokeyfactory()->register_matched_remote_datawriter(