Prevent potential null pointer dereference in CSSStyleSelector::applyProperty().
authormacpherson@chromium.org <macpherson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 21:51:48 +0000 (21:51 +0000)
committermacpherson@chromium.org <macpherson@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 21:51:48 +0000 (21:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84267

Reviewed by Kentaro Hara.

No new tests / code cleanup found via static analysis.

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp

index f605f68..50caafb 100644 (file)
@@ -1,5 +1,17 @@
 2012-04-18  Luke Macpherson  <macpherson@chromium.org>
 
+        Prevent potential null pointer dereference in CSSStyleSelector::applyProperty().
+        https://bugs.webkit.org/show_bug.cgi?id=84267
+
+        Reviewed by Kentaro Hara.
+
+        No new tests / code cleanup found via static analysis.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+
+2012-04-18  Luke Macpherson  <macpherson@chromium.org>
+
         Prevent switch case fallthrough in StylePropertySet::getPropertyValue().
         https://bugs.webkit.org/show_bug.cgi?id=84266
 
index e15d09b..cfbb53b 100644 (file)
@@ -3566,6 +3566,8 @@ void CSSStyleSelector::applyProperty(CSSPropertyID id, CSSValue *value)
         return;
     case CSSPropertyWebkitLocale: {
         HANDLE_INHERIT_AND_INITIAL(locale, Locale);
+        if (!primitiveValue)
+            return;
         if (primitiveValue->getIdent() == CSSValueAuto)
             m_style->setLocale(nullAtom);
         else