Fix crash in decode() on malformed input
This commit is contained in:
parent
7b42551a20
commit
968cad3328
@ -48,7 +48,9 @@ QByteArray QuotedPrintable::decode(const QString &input)
|
||||
|
||||
QByteArray output;
|
||||
|
||||
for (int i = 0; i < input.length(); ++i)
|
||||
int len = input.length();
|
||||
int i;
|
||||
for (i = 0; i < len-2; ++i)
|
||||
{
|
||||
if (input.at(i).toLatin1() == '=')
|
||||
{
|
||||
@ -61,5 +63,10 @@ QByteArray QuotedPrintable::decode(const QString &input)
|
||||
}
|
||||
}
|
||||
|
||||
while (i<len) {
|
||||
output.append(input.at(i).toLatin1());
|
||||
++i;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user