Title: [114678] trunk/Source/WebCore
Revision
114678
Author
[email protected]
Date
2012-04-19 15:03:01 -0700 (Thu, 19 Apr 2012)

Log Message

Eliminate potential null pointer dereference in CSSStyleSelector::containsUncommonAttributeSelector().
https://bugs.webkit.org/show_bug.cgi?id=84366

Reviewed by Kentaro Hara.

No new tests / code cleanup only.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114677 => 114678)


--- trunk/Source/WebCore/ChangeLog	2012-04-19 22:00:09 UTC (rev 114677)
+++ trunk/Source/WebCore/ChangeLog	2012-04-19 22:03:01 UTC (rev 114678)
@@ -1,5 +1,17 @@
 2012-04-19  Luke Macpherson  <[email protected]>
 
+        Eliminate potential null pointer dereference in CSSStyleSelector::containsUncommonAttributeSelector().
+        https://bugs.webkit.org/show_bug.cgi?id=84366
+
+        Reviewed by Kentaro Hara.
+
+        No new tests / code cleanup only.
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+
+2012-04-19  Luke Macpherson  <[email protected]>
+
         Fix null-pointer dereference in ApplyPropertyZoom::applyValue().
         https://bugs.webkit.org/show_bug.cgi?id=84279
 

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (114677 => 114678)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-04-19 22:00:09 UTC (rev 114677)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-04-19 22:03:01 UTC (rev 114678)
@@ -2307,18 +2307,19 @@
 
 static inline bool containsUncommonAttributeSelector(const CSSSelector* selector)
 {
-    while (selector) {
+    for (; selector; selector = selector->tagHistory()) {
         // Allow certain common attributes (used in the default style) in the selectors that match the current element.
         if (selector->isAttributeSelector() && !isCommonAttributeSelectorAttribute(selector->attribute()))
             return true;
         if (selectorListContainsUncommonAttributeSelector(selector))
             return true;
-        if (selector->relation() != CSSSelector::SubSelector)
+        if (selector->relation() != CSSSelector::SubSelector) {
+            selector = selector->tagHistory();
             break;
-        selector = selector->tagHistory();
-    };
+        }
+    }
 
-    for (selector = selector->tagHistory(); selector; selector = selector->tagHistory()) {
+    for (; selector; selector = selector->tagHistory()) {
         if (selector->isAttributeSelector())
             return true;
         if (selectorListContainsUncommonAttributeSelector(selector))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to