mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb+LibXML: Make Listener::set_source(ByteString) fallible
`set_source` takes a ByteString but the implementation might require a specific encoding. Make it fallible so that we don't need to crash in the case of invalid UTF-8 or similar. The test includes a sequence of invalid UTF-8 bytes that crash the browser without this change.
This commit is contained in:
parent
2397ae4af5
commit
b9554038ff
Notes:
github-actions[bot]
2025-10-02 00:27:16 +00:00
Author: https://github.com/rmg-x
Commit: b9554038ff
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6353
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/trflynn89
7 changed files with 25 additions and 5 deletions
1
Tests/LibWeb/Text/data/invalid_utf8_corrupt.svg
Normal file
1
Tests/LibWeb/Text/data/invalid_utf8_corrupt.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">À¯õ</svg>
|
||||
|
After Width: | Height: | Size: 74 B |
1
Tests/LibWeb/Text/expected/corrupt-svg-favicon.txt
Normal file
1
Tests/LibWeb/Text/expected/corrupt-svg-favicon.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
PASS (didn't crash)
|
||||
12
Tests/LibWeb/Text/input/corrupt-svg-favicon.html
Normal file
12
Tests/LibWeb/Text/input/corrupt-svg-favicon.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="icon" href="../data/invalid_utf8_corrupt.svg" type="image/svg+xml">
|
||||
</head>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println("PASS (didn't crash)")
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue