Changeset 144549 in webkit


Ignore:
Timestamp:
Mar 2, 2013 5:45:58 PM (11 years ago)
Author:
abarth@webkit.org
Message:

XSSAuditor has a subtle race condition when used with the threaded HTML parser
https://bugs.webkit.org/show_bug.cgi?id=111253

Reviewed by Eric Seidel.

We were refing and derefing a StringImpl for a main-thread
AtomicString. Using QualifiedNames on the background thread is very
fragile and we should figure out a more robust solution.

  • html/parser/XSSAuditor.cpp:

(WebCore::findAttributeWithName):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r144547 r144549  
     12013-03-02  Adam Barth  <abarth@webkit.org>
     2
     3        XSSAuditor has a subtle race condition when used with the threaded HTML parser
     4        https://bugs.webkit.org/show_bug.cgi?id=111253
     5
     6        Reviewed by Eric Seidel.
     7
     8        We were refing and derefing a StringImpl for a main-thread
     9        AtomicString. Using QualifiedNames on the background thread is very
     10        fragile and we should figure out a more robust solution.
     11
     12        * html/parser/XSSAuditor.cpp:
     13        (WebCore::findAttributeWithName):
     14
    1152013-03-02  Benjamin Poulain  <bpoulain@apple.com>
    216
  • trunk/Source/WebCore/html/parser/XSSAuditor.cpp

    r144544 r144549  
    128128static bool findAttributeWithName(const HTMLToken& token, const QualifiedName& name, size_t& indexOfMatchingAttribute)
    129129{
    130     String attrName = name.localName().string();
    131 
    132     if (name.namespaceURI() == XLinkNames::xlinkNamespaceURI)
    133         attrName = "xlink:" + attrName;
     130    // Notice that we're careful not to ref the StringImpl here because we might be on a background thread.
     131    const String& attrName = name.namespaceURI() == XLinkNames::xlinkNamespaceURI ? "xlink:" + name.localName().string() : name.localName().string();
    134132
    135133    for (size_t i = 0; i < token.attributes().size(); ++i) {
Note: See TracChangeset for help on using the changeset viewer.