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 #22163
This commit is contained in:
MacDue 2024-01-04 11:22:20 +00:00 committed by Andreas Kling
commit 5e973fca0b
Notes: sideshowbarker 2024-07-16 23:38:54 +09:00
3 changed files with 17 additions and 4 deletions