diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2011-11-01 16:55:19 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-01 23:43:54 +0100 |
commit | 851a94dea5fd523b1c487e50eff41c8e56fd8c4d (patch) | |
tree | 135afd67e8ddf8cdccf8aba1dbefdb2881816e29 /src | |
parent | afafc1d9cc8e6d3fc5da29251cdf5d3bb6404a1b (diff) |
QDeclarativeStyledText::parse on empty tag causes assert in QString
Task-number: QTBUG-22058
Change-Id: I7141002b751722ab34b378215251562153c4ff46
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/util/qdeclarativestyledtext.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativestyledtext.cpp b/src/declarative/util/qdeclarativestyledtext.cpp index 872bad6589..1c7ca5fbfd 100644 --- a/src/declarative/util/qdeclarativestyledtext.cpp +++ b/src/declarative/util/qdeclarativestyledtext.cpp @@ -234,6 +234,8 @@ bool QDeclarativeStyledTextPrivate::parseTag(const QChar *&ch, const QString &te int tagLength = 0; while (!ch->isNull()) { if (*ch == greaterThan) { + if (tagLength == 0) + return false; QStringRef tag(&textIn, tagStart, tagLength); const QChar char0 = tag.at(0); if (char0 == QLatin1Char('b')) { @@ -343,6 +345,8 @@ bool QDeclarativeStyledTextPrivate::parseCloseTag(const QChar *&ch, const QStrin int tagLength = 0; while (!ch->isNull()) { if (*ch == greaterThan) { + if (tagLength == 0) + return false; QStringRef tag(&textIn, tagStart, tagLength); const QChar char0 = tag.at(0); hasNewLine = false; |