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

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

Issue 23708049: Cap allocation for ImmutableStylePropertySet. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use ASSERT instead. Created 7 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: Source/core/css/StylePropertySet.cpp
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index 8df65b850b2c61cd7b3fc2056dc228650bf3e486..50f395951052d14a72ae8e7a2a935b7d674b12ca 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -50,6 +50,7 @@ static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count)
PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
{
+ ASSERT(count <= MaxArraySize);
void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCount(count));
return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssParserMode));
}
« 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