Check for tagToken length
Sometimes this part of the code causes segfault for me. I don't know what the root cause is though, it's *very* random. I guess the tagToken should always be long enough, but sometimes it's just one character.
This commit is contained in:
committed by
Tobias Fella
parent
8c4ea6180a
commit
ce1c6096d3
@@ -389,7 +389,7 @@ QString TextHandler::stripBlockTags(QString string, const QString &tagType) cons
|
|||||||
|
|
||||||
QString TextHandler::getTagType(const QString &tagToken) const
|
QString TextHandler::getTagType(const QString &tagToken) const
|
||||||
{
|
{
|
||||||
if (tagToken.isEmpty()) {
|
if (tagToken.isEmpty() || tagToken.length() < 2) {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
const int tagTypeStart = tagToken[1] == u'/' ? 2 : 1;
|
const int tagTypeStart = tagToken[1] == u'/' ? 2 : 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user