Skip to content

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

Open

Description

@ezrec

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

Activity

  1. added
    bug
    on Sep 7, 2023
  2. added this to the 4.4.1 milestone on Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions