Skip to content

ModbusResponse uninitialized fields. #18

@dlugaz

Description

@dlugaz

When constructing ModbusResponse from rawCRC data, field _address is left uninitialized.

It's understandable to not fill this field as there is no information about it in the frame, BUT as it is uninitialised, it contains pure gibberish, So accessing it with .registerAddress() is undefined behaviour.

I think the value should be initialized to some invalid value (-1/0xFFFF ?) and .registerAddress should throw if someone tries to access it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions