[Webkit-unassigned] [Bug 154540] New: JSString::value() should return the empty string when out of memory.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 22 09:39:49 PST 2016


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

            Bug ID: 154540
           Summary: JSString::value() should return the empty string when
                    out of memory.
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mark.lam at apple.com

The current implementation of JString::value() returns a null string when it fails to resolve its rope in the event of an OutOfMemory error.  This can result in null pointer dereferences if callers of the function uses the returned string without checking first for an exception or if the string is null.  We can make the code more resilient against such null pointer dereferences by having JSString::value() return an empty string instead of a null string.  Callers that previously checked for a null string (as an indication of the OutOfMemory error) can now check for an exception instead.

This task will do an audit of all uses of JSString::value() in the project and:
1. make sure that the uses are not dependent on the return string being null, and hence is ok with it returning an empty string.
2. add exception checks where needed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160222/9688e15e/attachment-0001.html>


More information about the webkit-unassigned mailing list