Fix double serialization of type_information in ReaderProxyData#6341
Open
PavelGuzenfeld wants to merge 1 commit into
Open
Fix double serialization of type_information in ReaderProxyData#6341PavelGuzenfeld wants to merge 1 commit into
PavelGuzenfeld wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5566
Two bugs in
ReaderProxyData:get_serialized_size()countedtype_informationtwice — once at lines 321-326 and again at lines 370-375, overstating the required buffer size.write_to_cdr_message()serializedtype_informationwith the wrong condition (m_type_idcheck instead oftype_information.assigned()), causing it to be written twice.Fix: remove the duplicate entries. The correct serialization (with
type_information.assigned()) is retained.Note:
WriterProxyDatadoes NOT have this bug — onlyReaderProxyData.Test plan
Signed-off-by: Pavel Guzenfeld me@pavelguzenfeld.com