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

Unified Diff: Source/core/rendering/AbstractInlineTextBox.cpp

Issue 542553002: Fix crash when trying to iterate over words in an inline text box of length zero. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « LayoutTests/accessibility/inline-text-word-boundary-causes-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/AbstractInlineTextBox.cpp
diff --git a/Source/core/rendering/AbstractInlineTextBox.cpp b/Source/core/rendering/AbstractInlineTextBox.cpp
index becc7cfbdff3b10b01113e25d1aa2b70def91fde..058280d7311df08ccb7fa53cd1c5f0fa9f0a48df 100644
--- a/Source/core/rendering/AbstractInlineTextBox.cpp
+++ b/Source/core/rendering/AbstractInlineTextBox.cpp
@@ -131,6 +131,9 @@ void AbstractInlineTextBox::wordBoundaries(Vector<WordBoundaries>& words) const
String text = this->text();
int len = text.length();
+ if (!len)
eseidel 2014/09/04 16:39:49 Should this be moved to after wordBreakIterator if
dmazzoni 2014/09/04 16:46:57 Sure. I was torn between catching the actual crash
+ return;
+
TextBreakIterator* iterator = wordBreakIterator(text, 0, len);
int pos = iterator->first();
while (pos >= 0 && pos < len) {
« no previous file with comments | « LayoutTests/accessibility/inline-text-word-boundary-causes-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698