Skip to content

[Issue] Missing bounds checking in read_from_file() #34

Description

@RomanAlexandroff

Problem

read_from_file() copies LittleFS file content into fixed-size RTC buffers using strcpy() without knowing the destination size.
Corrupt or manually edited files can overflow rtc_g.Secret, rtc_g.chat_id, or other buffers.

Expected behavior

File restore should never write past destination buffer size.

Suggested fix

Pass destination buffer size into read_from_file() and use bounded copy with explicit null termination.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions