eProsima / Fast-CDR

eProsima FastCDR library provides two serialization mechanisms. One is the standard CDR serialization mechanism, while the other is a faster implementation of it. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
145 stars 103 forks source link

Add missing clear when deserializing maps #232

Closed fschoenm closed 3 months ago

fschoenm commented 3 months ago

Description

See the linked Fast-DDS issue. In certain deserialization scenarios, a receiving map is not cleared which leads to an object containing random data from a previous message.

Fixes eProsima/Fast-DDS#5136

Contributor Checklist

Reviewer Checklist

Mario-DL commented 3 months ago

@fschoenm thanks for the contribution ! I have opened #233 in order to avoid problems with external contributions and ci. It also adds a test. Closing this PR in favor of the other.