Skip to content

UI: bound alert text copies to the destination buffer - #3721

Open
Amoulier wants to merge 1 commit into
meshcore-dev:devfrom
Amoulier:fix/ui-new-alert-copy-bound
Open

Amoulier wants to merge 1 commit into
meshcore-dev:devfrom
Amoulier:fix/ui-new-alert-copy-bound

Conversation

@Amoulier

@Amoulier Amoulier commented Oct 28, 2026 •

Copy link
Copy Markdown

UITask::showAlert copies its argument with strcpy into an 80-byte member. A longer alert can overwrite adjacent UI state. Use the existing size-bounded StrHelper::strzcpy with sizeof(_alert); shorter text and the alert duration keep their behavior.

Validation:

  • python test/ui_new_alert/run.py passed on Windows.
  • python3 test/ui_new_alert/run.py --sanitize passed under Linux ASan/UBSan.
  • python test/ui_new_alert/run.py --source-ref 42ded8da646c7fbe9ccb8c522441f7aa87767344 fails against the original code, as expected.
  • pio run -e muzi_base_uno_superIO_companion_radio_ble passed against dev (RadioLib 7.8.1).
  • git diff --check passed.

The standalone test extracts the real showAlert and strzcpy methods and the real alert-array declaration. It checks empty, short, boundary-length and oversized strings with adjacent-state canaries, without compiling a replacement implementation of the copy method. No protocol, notification policy or display layout changes.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant