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

COTPdoMapWrite: Add error checking to prevent uninitialized variable access. #142

Open
ezrec opened this issue Jul 10, 2023 · 0 comments · Fixed by #143
Open

COTPdoMapWrite: Add error checking to prevent uninitialized variable access. #142

ezrec opened this issue Jul 10, 2023 · 0 comments · Fixed by #143
Labels
bug Something isn't working
Milestone

Comments

@ezrec
Copy link

ezrec commented Jul 10, 2023

Describe the bug
COTPdoMapWrite does not have error checking on its read and write index operations, which lead to tests/unit/object/cia301/co_pdo_map being flaky (as it was missing the h1A00.0 SDO entry, and the
(failing) accesses to 1A00.0 in COTPdoMapWrite() were being ignored, and random stack data in 'mapn'
was used for calculations).

To Reproduce
Steps to reproduce the behavior:

  1. Run unit tests on gcc-12

Expected behavior

  • tests/unit/object/cia301/co_pdo_map passes reliably.

CANopen Stack (please complete the following information):

  • Device: Unit tests
  • OS: Linux
  • Version: develop branch

Additional context

  • Discovered via valgrind
@michael-hillmann michael-hillmann added the bug Something isn't working label Sep 7, 2023
@michael-hillmann michael-hillmann added this to the 4.4.1 milestone Sep 7, 2023
@michael-hillmann michael-hillmann linked a pull request Sep 7, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants