From df5e27dd0675fd95a1bdbfbf4700be7f665a6eed Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Sat, 3 May 2025 13:17:51 +0100 Subject: [PATCH] fix filebrowser crash caused when trying to select all files (L2) whilst a hidden file/folder exists. this crash was found by @WE1ZARD. to trigger it, press L2 in the filebrowser whilst a hidden file exists and the hide hidden is enabled. the was due to GetEntry(i) internally using m_entries_current, and the select all was using the index from m_entries_current. this would result in an index that goes oob, and as its a write, it crashes. --- sphaira/source/ui/menus/filebrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphaira/source/ui/menus/filebrowser.cpp b/sphaira/source/ui/menus/filebrowser.cpp index 87d2156..0920617 100644 --- a/sphaira/source/ui/menus/filebrowser.cpp +++ b/sphaira/source/ui/menus/filebrowser.cpp @@ -283,7 +283,7 @@ Menu::Menu(const std::vector& nro_entries) : MenuBase{"FileBrowser"_i1 const auto set = m_selected_count != m_entries_current.size(); - for (const auto& i : m_entries_current) { + for (u32 i = 0; i < m_entries_current.size(); i++) { auto& e = GetEntry(i); if (e.selected != set) { e.selected = set;