fix: consume the full 16-bit Member ID segment in DecodePaddedEPath#598
Open
MrAlaskan wants to merge 1 commit into
Open
Conversation
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
This PR fixes
DecodePaddedEPath()so that it fully consumes16-bit Member IDlogical path segments before request data parsing continues.Problem
DecodePaddedEPath()advances correctly for16-bit Class ID,16-bit Instance ID, and16-bit Attribute IDlogical segments by skipping the segment header and then consuming the following 16-bit value. However, the16-bit Member IDcase only advances past the segment header and increments the decoded word count without consuming the member value itself.As a result, the function reports that the full segment was consumed through
bytes_consumed, but the returned message pointer is still left in the middle of the EPATH.CreateMessageRouterRequestStructure()then uses that incorrect pointer as the start of the request data payload.This can misalign subsequent service data parsing for requests that contain a
16-bit Member IDsegment, which may lead to path parsing failures, parameter decoding errors, or other request payload misinterpretation.Changes
16-bit Member IDbranch inDecodePaddedEPath()consume the trailing 16-bit member value.