Skip to content

Returning C-array serious flaw #7

Open
@ghost

Description

The function isotp_continue_receive returns a copy of the structure IsoTpMessage.
But this one also embeds a C-array (payload) that has been allocated within the function, so, on the stack.

Due to this, once the function returns, the C-array points to some freed stack memory, and then may present corrupted data.

I got the issue running ARM based chipset: using the callback is safe, but the returned message contains garbage data.

I 've no idea of how to solve this without changing the API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions