[Webkit-unassigned] [Bug 238475] New: UTF-8 handling in MediaFragmentURIParser::parseFragments() seems wrong

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 28 16:01:01 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=238475

            Bug ID: 238475
           Summary: UTF-8 handling in
                    MediaFragmentURIParser::parseFragments() seems wrong
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
               URL: https://www.w3.org/2008/WebVideo/Fragments/WD-media-fr
                    agments-spec/#processing-name-value-components
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Media
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: cdumez at apple.com
                CC: darin at apple.com, eric.carlson at apple.com,
                    jer.noble at apple.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220328/d8bcd230/attachment-0001.htm>


More information about the webkit-unassigned mailing list