Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: Source/core/css/RuleSet.cpp

Issue 218403012: Check for null selectors when looping in findBestRuleSetAndAdd (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/css/RuleSet.cpp
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index fefc1e4310b1aa9006b8ffcfa65737dd361a0a0b..0f452c9b46e783ea771523386f78a0e847cf8bb1 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -177,10 +177,11 @@ bool RuleSet::findBestRuleSetAndAdd(const CSSSelector& component, RuleData& rule
#endif
const CSSSelector* it = &component;
- for (; it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
+ for (; it && it->relation() == CSSSelector::SubSelector; it = it->tagHistory()) {
extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
}
- extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
+ if (it)
ojan 2014/04/01 21:20:50 This makes me sad. I'm OK with the patch to fix th
chrishtr 2014/04/01 21:27:58 Done.
+ extractValuesforSelector(it, id, className, customPseudoElementName, tagName);
// Prefer rule sets in order of most likely to apply infrequently.
if (!id.isEmpty()) {
« LayoutTests/fast/css/inputtext-crash.html ('K') | « Source/core/css/CSSSelector.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698