WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
238475
UTF-8 handling in MediaFragmentURIParser::parseFragments() seems wrong
https://bugs.webkit.org/show_bug.cgi?id=238475
Summary
UTF-8 handling in MediaFragmentURIParser::parseFragments() seems wrong
Chris Dumez
Reported
2022-03-28 16:01:01 PDT
UTF-8 handling in MediaFragmentURIParser::parseFragments() seems wrong: ``` // b. Convert name and value to Unicode strings by interpreting them as UTF-8. If either // name or value are not valid UTF-8 strings, then remove the name-value pair from the list. bool validUTF8 = false; if (!name.isEmpty() && !value.isEmpty()) { name = String { name.utf8(StrictConversion).data() }; validUTF8 = !name.isEmpty(); if (validUTF8) { value = String { value.utf8(StrictConversion).data() }; validUTF8 = !value.isEmpty(); } } ``` Note that `String { }` parses the input string as latin1, not UTF-8. So we're converting to UTF-8 and then back as latin1.
Attachments
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2022-03-28 16:15:43 PDT
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/media_fragment_seek.html seems to be this only WPT test we have that exercises this logic, but doesn't actually seem to cover UTF-8 cases.
Chris Dumez
Comment 2
2022-03-28 16:23:55 PDT
(In reply to Chris Dumez from
comment #1
)
> imported/w3c/web-platform-tests/html/semantics/embedded-content/media- > elements/media_fragment_seek.html seems to be this only WPT test we have > that exercises this logic, but doesn't actually seem to cover UTF-8 cases.
Looks like there are quite a few related tests in media/media-fragments though.
Radar WebKit Bug Importer
Comment 3
2022-04-04 16:01:15 PDT
<
rdar://problem/91266173
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug