mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibLine: Avoid OOB access when one of the suggestions is the prefix
This commit is contained in:
committed by
Andreas Kling
parent
ef69f900c7
commit
730ca98698
@@ -385,7 +385,7 @@ String Editor::get_line(const String& prompt)
|
||||
last_valid_suggestion_char = m_suggestions[0].text[common_suggestion_prefix];
|
||||
|
||||
for (const auto& suggestion : m_suggestions) {
|
||||
if (suggestion.text.length() < common_suggestion_prefix || suggestion.text[common_suggestion_prefix] != last_valid_suggestion_char) {
|
||||
if (suggestion.text.length() <= common_suggestion_prefix || suggestion.text[common_suggestion_prefix] != last_valid_suggestion_char) {
|
||||
goto no_more_commons;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user