Skip to content

Fix double serialization of type_information in ReaderProxyData#6341

Open
PavelGuzenfeld wants to merge 1 commit into
eProsima:masterfrom
PavelGuzenfeld:fix/reader-proxy-data-serialization
Open

Fix double serialization of type_information in ReaderProxyData#6341
PavelGuzenfeld wants to merge 1 commit into
eProsima:masterfrom
PavelGuzenfeld:fix/reader-proxy-data-serialization

Conversation

@PavelGuzenfeld
Copy link
Copy Markdown

Summary

Fixes #5566

Two bugs in ReaderProxyData:

  1. get_serialized_size() counted type_information twice — once at lines 321-326 and again at lines 370-375, overstating the required buffer size.

  2. write_to_cdr_message() serialized type_information with the wrong condition (m_type_id check instead of type_information.assigned()), causing it to be written twice.

Fix: remove the duplicate entries. The correct serialization (with type_information.assigned()) is retained.

Note: WriterProxyData does NOT have this bug — only ReaderProxyData.

Test plan

  • ASan build clean
  • TopicPayloadPoolTests: 2563/2563 pass (ASan)
  • WaitSetImplTests: 3/3 pass (ASan)

Signed-off-by: Pavel Guzenfeld me@pavelguzenfeld.com

Two bugs in ReaderProxyData:

1. get_serialized_size() counted type_information twice — once at
   lines 321-326 and again at lines 370-375. This caused the
   calculated buffer size to be larger than needed.

2. write_to_cdr_message() serialized type_information with the wrong
   condition (m_type_id check instead of type_information.assigned()),
   causing it to be written twice — once incorrectly, once correctly.

Remove the duplicate entries in both methods. The correct serialization
at the later position (with type_information.assigned() condition) is
retained.

Fixes eProsima#5566

Signed-off-by: Pavel Guzenfeld <me@pavelguzenfeld.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect ReaderProxyData object serialization code

1 participant