Changeset 157341 in webkit
- Timestamp:
- Oct 12, 2013, 11:03:39 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 27 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/BumpPointerAllocator.h (modified) (3 diffs)
-
WTF/wtf/FastMalloc.cpp (modified) (2 diffs)
-
WTF/wtf/StringPrintStream.cpp (modified) (1 diff)
-
WTF/wtf/dtoa/utils.h (modified) (1 diff)
-
WTF/wtf/text/WTFString.cpp (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/indexeddb/IDBKeyPath.cpp (modified) (1 diff)
-
WebCore/Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp (modified) (1 diff)
-
WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp (modified) (1 diff)
-
WebCore/css/CSSFontSelector.cpp (modified) (1 diff)
-
WebCore/css/CSSParser.cpp (modified) (1 diff)
-
WebCore/html/HTMLCollection.cpp (modified) (3 diffs)
-
WebCore/html/HTMLFontElement.cpp (modified) (1 diff)
-
WebCore/html/parser/HTMLParserIdioms.cpp (modified) (4 diffs)
-
WebCore/inspector/InspectorStyleSheet.h (modified) (1 diff)
-
WebCore/platform/graphics/StringTruncator.cpp (modified) (4 diffs)
-
WebCore/platform/graphics/TextRun.h (modified) (1 diff)
-
WebCore/platform/text/BidiRunList.h (modified) (1 diff)
-
WebCore/rendering/svg/SVGInlineTextBox.cpp (modified) (2 diffs)
-
WebCore/rendering/svg/SVGTextChunkBuilder.cpp (modified) (1 diff)
-
WebCore/rendering/svg/SVGTextLayoutEngine.cpp (modified) (1 diff)
-
WebCore/rendering/svg/SVGTextQuery.cpp (modified) (1 diff)
-
WebCore/svg/SVGAnimationElement.cpp (modified) (1 diff)
-
WebCore/svg/SVGPathByteStreamSource.h (modified) (1 diff)
-
WebKit2/ChangeLog (modified) (1 diff)
-
WebKit2/Shared/Plugins/PluginQuirks.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r157330 r157341 1 2013-09-06 Jessica Pease <jessica_n_pease@apple.com> 2 3 Replace bounds checking ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION 4 https://bugs.webkit.org/show_bug.cgi?id=120893 5 6 Reviewed by Darin Adler. 7 8 * wtf/BumpPointerAllocator.h: 9 (WTF::BumpPointerPool::ensureCapacity): 10 (WTF::BumpPointerPool::alloc): 11 (WTF::BumpPointerPool::ensureCapacityCrossPool): 12 * wtf/FastMalloc.cpp: 13 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary): 14 * wtf/StringPrintStream.cpp: 15 (WTF::StringPrintStream::increaseSize): 16 * wtf/dtoa/utils.h: 17 (WTF::double_conversion::BufferReference::SubBufferReference): 18 * wtf/text/WTFString.cpp: 19 (WTF::String::fromUTF8): 20 1 21 2013-10-11 Darin Adler <darin@apple.com> 2 22 -
trunk/Source/WTF/wtf/BumpPointerAllocator.h
r114477 r157341 48 48 { 49 49 void* allocationEnd = static_cast<char*>(m_current) + size; 50 ASSERT (allocationEnd > m_current); // check for overflow50 ASSERT_WITH_SECURITY_IMPLICATION(allocationEnd > m_current); // check for overflow 51 51 if (allocationEnd <= static_cast<void*>(this)) 52 52 return this; … … 60 60 void* current = m_current; 61 61 void* allocationEnd = static_cast<char*>(current) + size; 62 ASSERT (allocationEnd > current); // check for overflow62 ASSERT_WITH_SECURITY_IMPLICATION(allocationEnd > current); // check for overflow 63 63 ASSERT(allocationEnd <= static_cast<void*>(this)); 64 64 m_current = allocationEnd; … … 164 164 void* current = pool->m_current; 165 165 void* allocationEnd = static_cast<char*>(current) + size; 166 ASSERT (allocationEnd > current); // check for overflow166 ASSERT_WITH_SECURITY_IMPLICATION(allocationEnd > current); // check for overflow 167 167 if (allocationEnd <= static_cast<void*>(pool)) 168 168 return pool; -
trunk/Source/WTF/wtf/FastMalloc.cpp
r156775 r157341 3800 3800 int used_slots = 0; 3801 3801 for (Span* s = sampled_objects.next; s != &sampled_objects; s = s->next) { 3802 ASSERT (used_slots < needed_slots);// Need to leave room for terminator3802 ASSERT_WITH_SECURITY_IMPLICATION(used_slots < needed_slots); // Need to leave room for terminator 3803 3803 StackTrace* stack = reinterpret_cast<StackTrace*>(s->objects); 3804 3804 if (used_slots + 3 + stack->depth >= needed_slots) { … … 4164 4164 skip++; 4165 4165 } 4166 ASSERT (skip < alloc);4166 ASSERT_WITH_SECURITY_IMPLICATION(skip < alloc); 4167 4167 if (skip > 0) { 4168 4168 Span* rest = pageheap->Split(span, skip); -
trunk/Source/WTF/wtf/StringPrintStream.cpp
r142434 r157341 107 107 void StringPrintStream::increaseSize(size_t newSize) 108 108 { 109 ASSERT (newSize > m_size);109 ASSERT_WITH_SECURITY_IMPLICATION(newSize > m_size); 110 110 ASSERT(newSize > sizeof(m_inlineBuffer)); 111 111 -
trunk/Source/WTF/wtf/dtoa/utils.h
r155958 r157341 154 154 BufferReference<T> SubBufferReference(int from, int to) { 155 155 ASSERT(to <= length_); 156 ASSERT (from < to);156 ASSERT_WITH_SECURITY_IMPLICATION(from < to); 157 157 ASSERT(0 <= from); 158 158 return BufferReference<T>(start() + from, to - from); -
trunk/Source/WTF/wtf/text/WTFString.cpp
r156948 r157341 850 850 851 851 unsigned utf16Length = bufferCurrent - bufferStart; 852 ASSERT (utf16Length < length);852 ASSERT_WITH_SECURITY_IMPLICATION(utf16Length < length); 853 853 return StringImpl::create(bufferStart, utf16Length); 854 854 } -
trunk/Source/WebCore/ChangeLog
r157340 r157341 1 2013-09-06 Jessica Pease <jessica_n_pease@apple.com> 2 3 Replace bounds checking ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION 4 https://bugs.webkit.org/show_bug.cgi?id=120893 5 6 Reviewed by Darin Adler. 7 8 * Modules/indexeddb/IDBKeyPath.cpp: 9 (WebCore::IDBKeyPathLexer::lex): 10 * Modules/indexeddb/IDBLevelDBCoding.cpp: 11 (WebCore::IDBLevelDBCoding::compareEncodedIDBKeys): 12 * bindings/js/JSCSSStyleDeclarationCustom.cpp: 13 (WebCore::cssPropertyIDForJSCSSPropertyName): 14 * css/CSSFontSelector.cpp: 15 (WebCore::compareFontFaces): 16 * css/CSSParser.cpp: 17 (WebCore::CSSParser::rewriteSpecifiers): 18 * html/HTMLCollection.cpp: 19 (WebCore::traverseMatchingElementsForwardToOffset): 20 (WebCore::LiveNodeListBase::traverseChildNodeListForwardToOffset): 21 (WebCore::HTMLCollection::traverseForwardToOffset): 22 * html/HTMLFontElement.cpp: 23 (WebCore::parseFontSize): 24 * html/parser/HTMLParserIdioms.cpp: 25 (WebCore::parseHTMLIntegerInternal): 26 (WebCore::parseHTMLNonNegativeIntegerInternal): 27 * inspector/InspectorStyleSheet.h: 28 (WebCore::InspectorStyleProperty::setRawTextFromStyleDeclaration): 29 * platform/graphics/StringTruncator.cpp: 30 (WebCore::centerTruncateToBuffer): 31 (WebCore::rightTruncateToBuffer): 32 (WebCore::truncateString): 33 * platform/graphics/TextRun.h: 34 (WebCore::TextRun::subRun): 35 * platform/text/BidiRunList.h: 36 (WebCore::::reverseRuns): 37 * rendering/svg/SVGInlineTextBox.cpp: 38 (WebCore::SVGInlineTextBox::selectionRectForTextFragment): 39 (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates): 40 * rendering/svg/SVGTextChunkBuilder.cpp: 41 (WebCore::SVGTextChunkBuilder::buildTextChunks): 42 * rendering/svg/SVGTextLayoutEngine.cpp: 43 (WebCore::SVGTextLayoutEngine::currentLogicalCharacterMetrics): 44 * rendering/svg/SVGTextQuery.cpp: 45 (WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates): 46 * svg/SVGAnimationElement.cpp: 47 (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): 48 * svg/SVGPathByteStreamSource.h: 49 (WebCore::SVGPathByteStreamSource::readType): 50 1 51 2013-10-12 Antti Koivisto <antti@apple.com> 2 52 -
trunk/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
r157330 r157341 76 76 if (m_ptr >= m_end) 77 77 return TokenEnd; 78 ASSERT (m_ptr < m_end);78 ASSERT_WITH_SECURITY_IMPLICATION(m_ptr < m_end); 79 79 80 80 if (*m_ptr == '.') { -
trunk/Source/WebCore/Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp
r156590 r157341 585 585 ok = true; 586 586 ASSERT(&ptrA != &ptrB); 587 ASSERT (ptrA < limitA);588 ASSERT (ptrB < limitB);587 ASSERT_WITH_SECURITY_IMPLICATION(ptrA < limitA); 588 ASSERT_WITH_SECURITY_IMPLICATION(ptrB < limitB); 589 589 unsigned char typeA = *ptrA++; 590 590 unsigned char typeB = *ptrB++; -
trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
r157215 r157341 261 261 } else 262 262 *bufferPtr++ = c; 263 ASSERT (bufferPtr < bufferEnd);264 } 265 ASSERT (bufferPtr < bufferEnd);263 ASSERT_WITH_SECURITY_IMPLICATION(bufferPtr < bufferEnd); 264 } 265 ASSERT_WITH_SECURITY_IMPLICATION(bufferPtr < bufferEnd); 266 266 *bufferPtr = '\0'; 267 267 -
trunk/Source/WebCore/css/CSSFontSelector.cpp
r157265 r157341 467 467 } 468 468 469 ASSERT (ruleSetIndex < fallbackRuleSets);469 ASSERT_WITH_SECURITY_IMPLICATION(ruleSetIndex < fallbackRuleSets); 470 470 const FontTraitsMask* weightFallbackRule = weightFallbackRuleSets[ruleSetIndex]; 471 471 for (unsigned i = 0; i < rulesPerSet; ++i) { -
trunk/Source/WebCore/css/CSSParser.cpp
r157330 r157341 12165 12165 const unsigned start = m_propertyRange.start; 12166 12166 const unsigned end = m_propertyRange.end; 12167 ASSERT (start < end);12167 ASSERT_WITH_SECURITY_IMPLICATION(start < end); 12168 12168 String propertyString; 12169 12169 if (is8BitSource()) -
trunk/Source/WebCore/html/HTMLCollection.cpp
r157065 r157341 325 325 inline Element* traverseMatchingElementsForwardToOffset(const NodeListType* nodeList, unsigned offset, Element* currentElement, unsigned& currentOffset, ContainerNode* root) 326 326 { 327 ASSERT (currentOffset < offset);327 ASSERT_WITH_SECURITY_IMPLICATION(currentOffset < offset); 328 328 while ((currentElement = nextMatchingElement(nodeList, currentElement, root))) { 329 329 if (++currentOffset == offset) … … 337 337 { 338 338 ASSERT(type() == ChildNodeListType); 339 ASSERT (currentOffset < offset);339 ASSERT_WITH_SECURITY_IMPLICATION(currentOffset < offset); 340 340 while ((currentNode = currentNode->nextSibling())) { 341 341 if (++currentOffset == offset) … … 549 549 inline Element* HTMLCollection::traverseForwardToOffset(unsigned offset, Element* currentElement, unsigned& currentOffset, unsigned& offsetInArray, ContainerNode* root) const 550 550 { 551 ASSERT (currentOffset < offset);551 ASSERT_WITH_SECURITY_IMPLICATION(currentOffset < offset); 552 552 if (overridesItemAfter()) { 553 553 offsetInArray = m_cachedElementsArrayOffset; -
trunk/Source/WebCore/html/HTMLFontElement.cpp
r155795 r157341 72 72 if (position == end) 73 73 return false; 74 ASSERT (position < end);74 ASSERT_WITH_SECURITY_IMPLICATION(position < end); 75 75 76 76 // Step 5 -
trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp
r156902 r157341 170 170 if (position == end) 171 171 return false; 172 ASSERT (position < end);172 ASSERT_WITH_SECURITY_IMPLICATION(position < end); 173 173 174 174 // Step 6 … … 180 180 if (position == end) 181 181 return false; 182 ASSERT (position < end);182 ASSERT_WITH_SECURITY_IMPLICATION(position < end); 183 183 184 184 // Step 7 … … 231 231 if (position == end) 232 232 return false; 233 ASSERT (position < end);233 ASSERT_WITH_SECURITY_IMPLICATION(position < end); 234 234 235 235 // Step 5 … … 240 240 if (position == end) 241 241 return false; 242 ASSERT (position < end);242 ASSERT_WITH_SECURITY_IMPLICATION(position < end); 243 243 244 244 // Step 7 -
trunk/Source/WebCore/inspector/InspectorStyleSheet.h
r155886 r157341 122 122 unsigned start = sourceData.range.start; 123 123 unsigned end = sourceData.range.end; 124 ASSERT (start < end);124 ASSERT_WITH_SECURITY_IMPLICATION(start < end); 125 125 ASSERT(end <= styleDeclaration.length()); 126 126 rawText = styleDeclaration.substring(start, end - start); -
trunk/Source/WebCore/platform/graphics/StringTruncator.cpp
r118568 r157341 60 60 static unsigned centerTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer) 61 61 { 62 ASSERT (keepCount < length);63 ASSERT (keepCount < STRING_BUFFER_SIZE);62 ASSERT_WITH_SECURITY_IMPLICATION(keepCount < length); 63 ASSERT_WITH_SECURITY_IMPLICATION(keepCount < STRING_BUFFER_SIZE); 64 64 65 65 unsigned omitStart = (keepCount + 1) / 2; … … 80 80 static unsigned rightTruncateToBuffer(const String& string, unsigned length, unsigned keepCount, UChar* buffer) 81 81 { 82 ASSERT (keepCount < length);83 ASSERT (keepCount < STRING_BUFFER_SIZE);82 ASSERT_WITH_SECURITY_IMPLICATION(keepCount < length); 83 ASSERT_WITH_SECURITY_IMPLICATION(keepCount < STRING_BUFFER_SIZE); 84 84 85 85 NonSharedCharacterBreakIterator it(string.characters(), length); … … 140 140 141 141 while (keepCountForLargestKnownToFit + 1 < keepCountForSmallestKnownToNotFit) { 142 ASSERT (widthForLargestKnownToFit <= maxWidth);143 ASSERT (widthForSmallestKnownToNotFit > maxWidth);142 ASSERT_WITH_SECURITY_IMPLICATION(widthForLargestKnownToFit <= maxWidth); 143 ASSERT_WITH_SECURITY_IMPLICATION(widthForSmallestKnownToNotFit > maxWidth); 144 144 145 145 float ratio = (keepCountForSmallestKnownToNotFit - keepCountForLargestKnownToFit) … … 153 153 } 154 154 155 ASSERT (keepCount < length);155 ASSERT_WITH_SECURITY_IMPLICATION(keepCount < length); 156 156 ASSERT(keepCount > 0); 157 ASSERT (keepCount < keepCountForSmallestKnownToNotFit);158 ASSERT (keepCount > keepCountForLargestKnownToFit);157 ASSERT_WITH_SECURITY_IMPLICATION(keepCount < keepCountForSmallestKnownToNotFit); 158 ASSERT_WITH_SECURITY_IMPLICATION(keepCount > keepCountForLargestKnownToFit); 159 159 160 160 truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer); -
trunk/Source/WebCore/platform/graphics/TextRun.h
r156393 r157341 140 140 TextRun subRun(unsigned startOffset, unsigned length) const 141 141 { 142 ASSERT (startOffset < m_len);142 ASSERT_WITH_SECURITY_IMPLICATION(startOffset < m_len); 143 143 144 144 TextRun result = *this; -
trunk/Source/WebCore/platform/text/BidiRunList.h
r95901 r157341 205 205 return; 206 206 207 ASSERT (end < m_runCount);207 ASSERT_WITH_SECURITY_IMPLICATION(end < m_runCount); 208 208 209 209 // Get the item before the start of the runs to reverse and put it in -
trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
r157011 r157341 109 109 FloatRect SVGInlineTextBox::selectionRectForTextFragment(const SVGTextFragment& fragment, int startPosition, int endPosition, RenderStyle* style) 110 110 { 111 ASSERT (startPosition < endPosition);111 ASSERT_WITH_SECURITY_IMPLICATION(startPosition < endPosition); 112 112 ASSERT(style); 113 113 … … 455 455 } 456 456 457 ASSERT (startPosition < endPosition);457 ASSERT_WITH_SECURITY_IMPLICATION(startPosition < endPosition); 458 458 return true; 459 459 } -
trunk/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
r156094 r157341 63 63 foundStart = true; 64 64 } else { 65 ASSERT (boxPosition > lastChunkStartPosition);65 ASSERT_WITH_SECURITY_IMPLICATION(boxPosition > lastChunkStartPosition); 66 66 addTextChunk(lineLayoutBoxes, lastChunkStartPosition, boxPosition - lastChunkStartPosition); 67 67 lastChunkStartPosition = boxPosition; -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
r156151 r157341 368 368 369 369 ASSERT(textMetricsSize); 370 ASSERT (m_logicalMetricsListOffset < textMetricsSize);370 ASSERT_WITH_SECURITY_IMPLICATION(m_logicalMetricsListOffset < textMetricsSize); 371 371 logicalMetrics = textMetricsValues->at(m_logicalMetricsListOffset); 372 372 if (logicalMetrics.isEmpty() || (!logicalMetrics.width() && !logicalMetrics.height())) { -
trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp
r156094 r157341 152 152 return false; 153 153 154 ASSERT (startPosition < endPosition);154 ASSERT_WITH_SECURITY_IMPLICATION(startPosition < endPosition); 155 155 return true; 156 156 } -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r155815 r157341 538 538 from = m_values[index]; 539 539 to = m_values[index + 1]; 540 ASSERT (toPercent > fromPercent);540 ASSERT_WITH_SECURITY_IMPLICATION(toPercent > fromPercent); 541 541 effectivePercent = (percent - fromPercent) / (toPercent - fromPercent); 542 542 -
trunk/Source/WebCore/svg/SVGPathByteStreamSource.h
r120044 r157341 64 64 65 65 for (size_t i = 0; i < typeSize; ++i) { 66 ASSERT (m_streamCurrent < m_streamEnd);66 ASSERT_WITH_SECURITY_IMPLICATION(m_streamCurrent < m_streamEnd); 67 67 data.bytes[i] = *m_streamCurrent; 68 68 ++m_streamCurrent; -
trunk/Source/WebKit2/ChangeLog
r157337 r157341 1 2013-09-06 Jessica Pease <jessica_n_pease@apple.com> 2 3 Replace bounds checking ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION 4 https://bugs.webkit.org/show_bug.cgi?id=120893 5 6 Reviewed by Darin Adler. 7 8 * Shared/Plugins/PluginQuirks.h: 9 (WebKit::PluginQuirks::add): 10 1 11 2013-10-12 Darin Adler <darin@apple.com> 2 12 -
trunk/Source/WebKit2/Shared/Plugins/PluginQuirks.h
r142314 r157341 114 114 { 115 115 ASSERT(quirk >= 0); 116 ASSERT (quirk < NumPluginQuirks);116 ASSERT_WITH_SECURITY_IMPLICATION(quirk < NumPluginQuirks); 117 117 118 118 m_quirks |= (1 << quirk);
Note:
See TracChangeset
for help on using the changeset viewer.