Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TcoControlZone no safeguards for arrays #148

Open
KrisztianOlah opened this issue Aug 28, 2024 · 0 comments
Open

[BUG] TcoControlZone no safeguards for arrays #148

KrisztianOlah opened this issue Aug 28, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@KrisztianOlah
Copy link
Contributor

KrisztianOlah commented Aug 28, 2024

Describe the bug
Arrrays are declared using magic numbers, which are not checked when iterating through them; It is resulting in out of bound errors which are caught later by TcOpen with the less helpful error message of: "PlcTask(xxx): Checkbounds: Index too high (n)"
Also Config is set to trigger this error by default as MaxKeymode is set to 4 while the array only has 3 elements.
Furthermore, if the code is called cyclically by mistake, it will cog up Visual Studio's error pipe and VS becomes unresponsive.

To Reproduce
Call Restore() or any of the add methods on any TcoControlZone with the wrong config.

Expected behavior
When the out of bounds error would occur the for loops are terminated and a specific error message reported via Messenger to dignostics.

Screenshots
image

@KrisztianOlah KrisztianOlah added the bug Something isn't working label Aug 28, 2024
@PTKu PTKu assigned peterbarancek and unassigned PTKu Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants