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

Unified Diff: third_party/WebKit/Source/core/css/SelectorFilter.cpp

Issue 2376703002: Speculative fix for SelectorFilter crash. (Closed)
Patch Set: Added DCHECK + comment Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/SelectorFilter.cpp
diff --git a/third_party/WebKit/Source/core/css/SelectorFilter.cpp b/third_party/WebKit/Source/core/css/SelectorFilter.cpp
index deb464e4eaf47d7cd877bd56831d9a5ec1e88490..07381af7178cc4f10056f0a88c062616467dca46 100644
--- a/third_party/WebKit/Source/core/css/SelectorFilter.cpp
+++ b/third_party/WebKit/Source/core/css/SelectorFilter.cpp
@@ -45,8 +45,12 @@ static inline void collectElementIdentifierHashes(const Element& element, Vector
if (element.isStyledElement() && element.hasClass()) {
const SpaceSplitString& classNames = element.classNames();
size_t count = classNames.size();
- for (size_t i = 0; i < count; ++i)
- identifierHashes.append(classNames[i].impl()->existingHash() * ClassAttributeSalt);
+ for (size_t i = 0; i < count; ++i) {
+ DCHECK(classNames[i].impl());
+ // Speculative fix for https://crbug.com/646026
+ if (classNames[i].impl())
+ identifierHashes.append(classNames[i].impl()->existingHash() * ClassAttributeSalt);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698