mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Use code unit offsets in Document::find_matching_text()
We were passing in byte offsets instead of UTF-16 code unit offsets, which could lead to crashes if the offsets found exceeded the number of code units in text fragments on the page. Fixes #4908. Co-authored-by: Tim Ledbetter <tim.ledbetter@ladybird.org>
This commit is contained in:
parent
cc0a28ee7d
commit
b42c2c5e8f
Notes:
github-actions[bot]
2025-06-13 13:10:45 +00:00
Author: https://github.com/gmta
Commit: b42c2c5e8f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5067
Reviewed-by: https://github.com/tcl3
Reviewed-by: https://github.com/trflynn89
5 changed files with 24 additions and 15 deletions
|
@ -814,7 +814,7 @@ public:
|
|||
// Does document represent an embedded svg img
|
||||
[[nodiscard]] bool is_decoded_svg() const;
|
||||
|
||||
Vector<GC::Root<DOM::Range>> find_matching_text(String const&, CaseSensitivity);
|
||||
Vector<GC::Root<Range>> find_matching_text(String const&, CaseSensitivity);
|
||||
|
||||
void parse_html_from_a_string(StringView);
|
||||
static GC::Ref<Document> parse_html_unsafe(JS::VM&, StringView);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue