⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 122923 in webkit


Ignore:
Timestamp:
Jul 18, 2012, 12:09:21 AM (14 years ago)
Author:
macpherson@chromium.org
Message:

Fix null pointer dereference introduced by Changeset 121874.
https://bugs.webkit.org/show_bug.cgi?id=91578

Reviewed by Pavel Feldman.

In http://trac.webkit.org/changeset/121874/trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp I introduced code that
dereferences the return value of ownerDocument() without doing a null check. This was a bad idea.

No new tests. I don't have a repro case, but it is clear from reading the code for ownerDocument() that it can return null.

  • inspector/InspectorStyleSheet.cpp:

(WebCore::InspectorStyleSheet::ensureSourceData):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122922 r122923  
     12012-07-18  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Fix null pointer dereference introduced by Changeset 121874.
     4        https://bugs.webkit.org/show_bug.cgi?id=91578
     5
     6        Reviewed by Pavel Feldman.
     7
     8        In http://trac.webkit.org/changeset/121874/trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp I introduced code that
     9        dereferences the return value of ownerDocument() without doing a null check. This was a bad idea.
     10
     11        No new tests. I don't have a repro case, but it is clear from reading the code for ownerDocument() that it can return null.
     12
     13        * inspector/InspectorStyleSheet.cpp:
     14        (WebCore::InspectorStyleSheet::ensureSourceData):
     15
    1162012-07-17  Yoshifumi Inoue  <yosin@chromium.org>
    217
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r121874 r122923  
    11171117
    11181118    RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create();
    1119     CSSParser p(m_pageStyleSheet->ownerDocument());
     1119    Document* ownerDocument = m_pageStyleSheet->ownerDocument();
     1120    CSSParser p(ownerDocument ?  CSSParserContext(ownerDocument) : strictCSSParserContext());
    11201121    OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDataList());
    11211122    p.parseSheet(newStyleSheet.get(), m_parsedStyleSheet->text(), 0, ruleSourceDataResult.get());
Note: See TracChangeset for help on using the changeset viewer.