[Webkit-unassigned] [Bug 73849] New: In FontCacheAndroid.cpp should keep the pointer valid returned from CString::data()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 5 11:29:47 PST 2011


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

           Summary: In FontCacheAndroid.cpp should keep the pointer valid
                    returned from CString::data()
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Android
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: wangxianzhu at chromium.org
                CC: abarth at webkit.org, peter at chromium.org


In FontCacheAndroid.cpp, name will be invalid after the following piece of code if name is got from String::utf8().data(), because the temporary CString returned from String::utf8() has been destructed after that statement.

FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
{
    const char* name = 0;

    // If a fallback font is being created (e.g. "-webkit-monospace"), convert
    // it in to the fallback name (e.g. "monospace").
    if (!family.length() || family.startsWith("-webkit-"))
        name = getFallbackFontName(fontDescription);
    else
        name = family.string().utf8().data();

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



More information about the webkit-unassigned mailing list