Skip to content

Add missing length check in EncodeEPath function#578

Merged
MartinMelikMerkumians merged 1 commit into
EIPStackGroup:masterfrom
MaxjATL:bugfix
May 29, 2026
Merged

Add missing length check in EncodeEPath function#578
MartinMelikMerkumians merged 1 commit into
EIPStackGroup:masterfrom
MaxjATL:bugfix

Conversation

@MaxjATL
Copy link
Copy Markdown
Contributor

@MaxjATL MaxjATL commented May 29, 2026

EncodeEpath assumes that at the very least the Epath it has been given has at least one segment. This is not necessarily true. Take for example the TCP/IP interface object attribute 4. For a device with multiple physical interfaces that correspond to the TCP/IP interface, this attribute can contain a path size of zero.

Without this check the encoding will be wrong and the assertion present in this function will fail.

EncodeEpath assumes that at the very least the Epath it has been given
has at least one segment. This is not necessarily true. Take for example
the TCP/IP interface object attribute 4. For a device with multiple
physical interfaces that correspond to the TCP/IP interface, this
attribute can contain a path size of zero.

Without this check the encoding will be wrong and the assertion present
in this function will fail.
@MartinMelikMerkumians
Copy link
Copy Markdown
Member

Thanks for your contribution @MaxjATL
Makes total sense, also from the view of defensive programming. This would be easy to use to crash OpENer via the assert

@MartinMelikMerkumians MartinMelikMerkumians merged commit 36943e6 into EIPStackGroup:master May 29, 2026
0 of 2 checks passed
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.

2 participants