diff --git a/src/cpp/rtps/messages/MessageReceiver.cpp b/src/cpp/rtps/messages/MessageReceiver.cpp index 8df4d532a11..36caa365f70 100644 --- a/src/cpp/rtps/messages/MessageReceiver.cpp +++ b/src/cpp/rtps/messages/MessageReceiver.cpp @@ -1047,6 +1047,8 @@ bool MessageReceiver::proc_Submsg_DataFrag( { EPROSIMA_LOG_WARNING(RTPS_MSG_IN, IDSTRING "Serialized Payload value invalid or larger than maximum allowed size " "(" << payload_size << "/" << (msg->length - msg->pos) << ")"); + ch.serializedPayload.data = nullptr; + ch.inline_qos.data = nullptr; return false; } } diff --git a/test/blackbox/common/BlackboxTestsTransportUDP.cpp b/test/blackbox/common/BlackboxTestsTransportUDP.cpp index 6140fb90ad5..da3cae10add 100644 --- a/test/blackbox/common/BlackboxTestsTransportUDP.cpp +++ b/test/blackbox/common/BlackboxTestsTransportUDP.cpp @@ -552,6 +552,7 @@ TEST(TransportUDP, DatagramInjection) ASSERT_FALSE(receivers.empty()); deliver_datagram_from_file(receivers, "datagrams/16784.bin"); + deliver_datagram_from_file(receivers, "datagrams/20140.bin"); } // Test for ==operator UDPTransportDescriptor is not required as it is an abstract class and in UDPv4 is same method diff --git a/test/blackbox/datagrams/20140.bin b/test/blackbox/datagrams/20140.bin new file mode 100644 index 00000000000..7844c824037 Binary files /dev/null and b/test/blackbox/datagrams/20140.bin differ