mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
less: Fix out of bounds StringView indexing
This fixes indexing the StringView before knowing if the index
is valid. This did not crash until the changes from 13406b8
which added runtime checks for StringView indexing.
This commit is contained in:
parent
d1671d4f86
commit
9d0dccaa3f
Notes:
sideshowbarker
2024-07-17 08:32:24 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/9d0dccaa3f Pull-request: https://github.com/SerenityOS/serenity/pull/14704
@ -332,7 +332,7 @@ private:
|
||||
|
||||
size_t render_status_line(StringView prompt, size_t off = 0, char end = '\0', bool ignored = false)
|
||||
{
|
||||
for (; prompt[off] != end && off < prompt.length(); ++off) {
|
||||
for (; off < prompt.length() && prompt[off] != end; ++off) {
|
||||
if (ignored)
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user