forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Prevent OOB access in HTMLEncodingDetection for input of '</'
Previously, this never checked if `position + 2` was valid. This slightly reorders the loop so all indices are checked. Fixes SerenityOS#22163
- Loading branch information
1 parent
3f52d60
commit 5e973fc
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Tests/LibWeb/Layout/expected/incomplete-input-no-newline-at-eof-should-not-crash.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Viewport <#document> at (0,0) content-size 800x600 children: not-inline | ||
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline | ||
BlockContainer <body> at (8,8) content-size 784x17.46875 children: inline | ||
line 0 width: 14.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 | ||
frag 0 from TextNode start: 0, length: 2, rect: [8,8 14.65625x17.46875] | ||
"</" | ||
TextNode <#text> | ||
|
||
ViewportPaintable (Viewport<#document>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600] | ||
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17.46875] | ||
TextPaintable (TextNode<#text>) |
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Layout/input/incomplete-input-no-newline-at-eof-should-not-crash.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
</ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters