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

Unified Diff: Source/core/html/HTMLDimension.cpp

Issue 1072483004: Handle huge values for cols/rows in frameset (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 8 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 | « LayoutTests/fast/frames/invalid-cols-rows-value-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLDimension.cpp
diff --git a/Source/core/html/HTMLDimension.cpp b/Source/core/html/HTMLDimension.cpp
index 18b3bf1a610c975d4844929998b34618b53b20c2..c85e02d019588aafb8c14587564ae5217f1c06a3 100644
--- a/Source/core/html/HTMLDimension.cpp
+++ b/Source/core/html/HTMLDimension.cpp
@@ -57,7 +57,8 @@ static HTMLDimension parseDimension(const CharacterType* characters, size_t last
if (position > lastParsedIndex) {
bool ok = false;
unsigned integerValue = charactersToUIntStrict(characters + lastParsedIndex, position - lastParsedIndex, &ok);
- ASSERT(ok);
+ if (!ok)
+ return HTMLDimension(0., HTMLDimension::Relative);
value += integerValue;
if (position < endOfCurrentToken && characters[position] == '.') {
@@ -71,7 +72,8 @@ static HTMLDimension parseDimension(const CharacterType* characters, size_t last
if (fractionNumbers.size()) {
double fractionValue = charactersToUIntStrict(fractionNumbers.data(), fractionNumbers.size(), &ok);
- ASSERT(ok);
+ if (!ok)
+ return HTMLDimension(0., HTMLDimension::Relative);
value += fractionValue / pow(10., static_cast<double>(fractionNumbers.size()));
}
« no previous file with comments | « LayoutTests/fast/frames/invalid-cols-rows-value-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698