mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 18:24:45 -05:00
LibLine: Avoid OOB access when one of the suggestions is the prefix
This commit is contained in:
parent
ef69f900c7
commit
730ca98698
Notes:
sideshowbarker
2024-07-19 07:24:29 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/730ca986988 Pull-request: https://github.com/SerenityOS/serenity/pull/1908
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue