Shell: Fix Vector OOB access in `add_entry_to_cache()'

Fixes #3530.
This commit is contained in:
AnotherTest 2020-09-18 11:22:52 +04:30 committed by Andreas Kling
parent a43d9c4fe0
commit 29ef65c458
Notes: sideshowbarker 2024-07-19 02:20:31 +09:00

View file

@ -1047,7 +1047,7 @@ void Shell::add_entry_to_cache(const String& entry)
if (match)
return;
while (strcmp(cached_path[index].characters(), entry.characters()) < 0) {
while (index < cached_path.size() && strcmp(cached_path[index].characters(), entry.characters()) < 0) {
index++;
}
cached_path.insert(index, entry);