From a73d86edbe16b953fbc16a42b23e8932c8676654 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:17:25 +0200 Subject: [PATCH] Fix oss-fuzz build (#5122) (#5131) Signed-off-by: Miguel Company (cherry picked from commit 89720fc065d48c5295838e600bc773f0f40ff868) Co-authored-by: Miguel Company --- include/fastdds/rtps/messages/MessageReceiver.h | 3 +++ src/cpp/rtps/messages/MessageReceiver.cpp | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/fastdds/rtps/messages/MessageReceiver.h b/include/fastdds/rtps/messages/MessageReceiver.h index 5ea5daadcbc..91f472e9db2 100644 --- a/include/fastdds/rtps/messages/MessageReceiver.h +++ b/include/fastdds/rtps/messages/MessageReceiver.h @@ -78,7 +78,10 @@ class MessageReceiver std::vector associated_writers_; std::unordered_map> associated_readers_; +#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) + //!Pointer to the RTPSParticipantImpl RTPSParticipantImpl* participant_; +#endif // if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) //!Protocol version of the message ProtocolVersion_t source_version_; //!VendorID that created the message diff --git a/src/cpp/rtps/messages/MessageReceiver.cpp b/src/cpp/rtps/messages/MessageReceiver.cpp index 5439693a071..bed6edcc17c 100644 --- a/src/cpp/rtps/messages/MessageReceiver.cpp +++ b/src/cpp/rtps/messages/MessageReceiver.cpp @@ -48,7 +48,12 @@ namespace rtps { MessageReceiver::MessageReceiver( RTPSParticipantImpl* participant, uint32_t rec_buffer_size) - : participant_(participant) + : mtx_() + , associated_writers_() + , associated_readers_() +#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) + , participant_(participant) +#endif // if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) , source_version_(c_ProtocolVersion) , source_vendor_id_(c_VendorId_Unknown) , source_guid_prefix_(c_GuidPrefix_Unknown)