[Webkit-unassigned] [Bug 20313] New: Add null check in String::fromUTF8()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 6 21:48:03 PDT 2008


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

           Summary: Add null check in String::fromUTF8()
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Text
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: alp at nuanti.com
OtherBugsDependingO 17432
             nThis:


String::fromUTF8() crashes when passed a null pointer. This behaviour is
inconsistent with the other constructors, which return a null String() in this
case:

String::String(const char* str)
{
    if (!str)
        return;
    m_impl = StringImpl::create(str);
}

String::String(const char* str, unsigned length)
{
    if (!str)
        return;
    m_impl = StringImpl::create(str, length);
}

Fix attached. This allows us to simplify (or avoid) null checking logic
wherever String::fromUTF8() is used.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list