Title: [122923] trunk/Source/WebCore
Revision
122923
Author
macpher...@chromium.org
Date
2012-07-18 00:09:21 -0700 (Wed, 18 Jul 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122922 => 122923)


--- trunk/Source/WebCore/ChangeLog	2012-07-18 06:50:25 UTC (rev 122922)
+++ trunk/Source/WebCore/ChangeLog	2012-07-18 07:09:21 UTC (rev 122923)
@@ -1,3 +1,18 @@
+2012-07-18  Luke Macpherson   <macpher...@chromium.org>
+
+        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):
+
 2012-07-17  Yoshifumi Inoue  <yo...@chromium.org>
 
         Decimal constructor with 99999999999999999 loses last digit

Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (122922 => 122923)


--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2012-07-18 06:50:25 UTC (rev 122922)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp	2012-07-18 07:09:21 UTC (rev 122923)
@@ -1116,7 +1116,8 @@
         return false;
 
     RefPtr<StyleSheetContents> newStyleSheet = StyleSheetContents::create();
-    CSSParser p(m_pageStyleSheet->ownerDocument());
+    Document* ownerDocument = m_pageStyleSheet->ownerDocument();
+    CSSParser p(ownerDocument ?  CSSParserContext(ownerDocument) : strictCSSParserContext());
     OwnPtr<RuleSourceDataList> ruleSourceDataResult = adoptPtr(new RuleSourceDataList());
     p.parseSheet(newStyleSheet.get(), m_parsedStyleSheet->text(), 0, ruleSourceDataResult.get());
     m_parsedStyleSheet->setSourceData(ruleSourceDataResult.release());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to