Commit c9f7f5d8 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

fix crash due to out-of-range index access

BUG: 277385
parent 77f5f2a8
......@@ -31,8 +31,10 @@ static QList<QString> explode(QString str, size_t max)
QList<QString> ret;
QString curr;
QString currWord;
if(str[str.size() - 1] != '\n')
if (str.size() > 0 && !str.endsWith('\n')) {
str += '\n';
}
for(int i = 0; i != str.size(); ++i)
{
if(str[i] == '\n')
......
Supports Markdown
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