Commit dc9d96ff authored by barraclough@apple.com's avatar barraclough@apple.com
Browse files

Bug 36052 - [Qt] REGRESSION(55878) 63 test cases crash

Reviewed by Geoff Garen.

r55878 changed UStringImpl::empty()->characters() to be non-null,
so TextBreakIteratorQt.cpp now should check the length of strings
(previously was assuming all strings with a non-null data pointer
had a length of at least 1).

* platform/text/qt/TextBreakIteratorQt.cpp:
(WebCore::wordBreakIterator):
(WebCore::characterBreakIterator):
(WebCore::lineBreakIterator):
(WebCore::sentenceBreakIterator):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0ea4f58a
2010-03-12 Gavin Barraclough <barraclough@apple.com>
Reviewed by Geoff Garen.
Bug 36052 - [Qt] REGRESSION(55878) 63 test cases crash
r55878 changed UStringImpl::empty()->characters() to be non-null,
so TextBreakIteratorQt.cpp now should check the length of strings
(previously was assuming all strings with a non-null data pointer
had a length of at least 1).
* platform/text/qt/TextBreakIteratorQt.cpp:
(WebCore::wordBreakIterator):
(WebCore::characterBreakIterator):
(WebCore::lineBreakIterator):
(WebCore::sentenceBreakIterator):
2010-03-12 Dirk Schulze <krit@webkit.org>
 
Reviewed by Nikolas Zimmermann.
......
......@@ -40,7 +40,7 @@ namespace WebCore {
TextBreakIterator* wordBreakIterator(const UChar* string, int length)
{
if (!string)
if (!string || !length)
return 0;
if (!iterator)
iterator = new QTextBoundaryFinder;
......@@ -51,7 +51,7 @@ namespace WebCore {
TextBreakIterator* characterBreakIterator(const UChar* string, int length)
{
if (!string)
if (!string || !length)
return 0;
if (!iterator)
iterator = new QTextBoundaryFinder;
......@@ -68,7 +68,7 @@ namespace WebCore {
TextBreakIterator* lineBreakIterator(const UChar* string, int length)
{
static QTextBoundaryFinder *iterator = 0;
if (!string)
if (!string || !length)
return 0;
if (!iterator)
iterator = new QTextBoundaryFinder;
......@@ -79,7 +79,7 @@ namespace WebCore {
TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
{
if (!string)
if (!string || !length)
return 0;
if (!iterator)
iterator = new QTextBoundaryFinder;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment