mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
Both call sites of buildVisibleOrder wrote into a fixed-size 11-int stack buffer. After FAVOURITES landed, HomePage::Count became 12; in the common case where all pages are visible, buildVisibleOrder writes 12 entries — one past the end. That OOB write trashed whatever lived next on the stack (typically the loop variable in navPage), so LEFT wrap-around behaved randomly: sometimes locked at the first page, sometimes jumped to a wrong one. User-visible as "menu doesn't wrap to the left". Size the buffer to `(int)Count` so it tracks the enum and grows with any future home page additions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>