Skip to content

fix: consume the full 16-bit Member ID segment in DecodePaddedEPath#598

Open
MrAlaskan wants to merge 1 commit into
EIPStackGroup:masterfrom
MrAlaskan:fix/cipcommon-consume-16bit-member-id-epath-segment
Open

fix: consume the full 16-bit Member ID segment in DecodePaddedEPath#598
MrAlaskan wants to merge 1 commit into
EIPStackGroup:masterfrom
MrAlaskan:fix/cipcommon-consume-16bit-member-id-epath-segment

Conversation

@MrAlaskan

Copy link
Copy Markdown

Summary

This PR fixes DecodePaddedEPath() so that it fully consumes 16-bit Member ID logical path segments before request data parsing continues.

Problem

DecodePaddedEPath() advances correctly for 16-bit Class ID, 16-bit Instance ID, and 16-bit Attribute ID logical segments by skipping the segment header and then consuming the following 16-bit value. However, the 16-bit Member ID case 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 ID segment, which may lead to path parsing failures, parameter decoding errors, or other request payload misinterpretation.

Changes

  • Make the 16-bit Member ID branch in DecodePaddedEPath() consume the trailing 16-bit member value.

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.

1 participant