[Webkit-unassigned] [Bug 281917] New: WTF::StringImpl::createSubstringSharingImpl() should use std::span instead of pointer math

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 22 13:55:38 PDT 2024


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

            Bug ID: 281917
           Summary: WTF::StringImpl::createSubstringSharingImpl() should
                    use std::span instead of pointer math
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org

WTF::StringImpl::createSubstringSharingImpl() should use std::span instead of pointer math.

Code like this avoids bounds checks:

```
        if (substringSize >= allocationSize<LChar>(length))
            return create(std::span { rep.m_data8 + offset, length });
```

Found by std::span clang static analysis checker under development.

-- 
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/20241022/0b532d57/attachment.htm>


More information about the webkit-unassigned mailing list