Skip to content

RegionSystem::load() Always Returns true (Ignores Read Failures) #1891

Description

@jirogit

Problem

src/helpers/RegionMap.cpp
RegionSystem::load() tracks file read success using a success flag, but the function always returns true at the end:

file.close();
return true;

This ignores any read failures that may have occurred during loading.

Why This Is a Problem

If the file is:
Truncated
Corrupted
Partially written

load() will still report success, leading to:

Silent data corruption
Incomplete region tables
Difficult debugging of storage issues

Expected Behavior

load() should return false if any read operation fails.

Proposed Fix

Replace:
return true;
With:
return success;

Impact

Improves reliability and ensures proper error propagation when region storage fails.


I guess I need to write a pull request, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FirmwarebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions