Skip to content

bug: VLA (Variable Length Array) in LoRa driver receive() #42

@gdellis

Description

@gdellis

Problem

sx1262.cpp:428 uses a C99 Variable Length Array: uint8_t rx_data[*actual_len + 1]. VLAs are dangerous on embedded systems with limited stack space and aren't valid in strict C++ without an extension.

Location

  • firmware/main/lora/sx1262.cpp:428

Severity

HIGH - Stack overflow risk, undefined behavior in strict C++

Suggested Fix

Use std::vector<uint8_t> or dynamic allocation with new[] instead.

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