Skip to content

bug: geofence zone partial load can cause memory corruption #46

@gdellis

Description

@gdellis

Problem

In state_machine.cpp:210-227, if loading zones from NVS partially fails (e.g., latitude loads but longitude fails), the zone is used anyway with corrupted coordinates. The any_read_ok flag is per-field, not per-zone, so partial zone data can be used.

Location

  • firmware/main/state_machine.cpp:210-227

Severity

HIGH - Geofence breach detection using corrupted coordinates

Suggested Fix

Add per-zone validation - if any field of a zone fails to load, mark that zone invalid or skip it entirely.

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