Fix infinite loop that can be triggered by some invalid html

This commit is contained in:
Nicolas Werner 2022-09-27 21:58:24 +02:00
parent d103f793bf
commit 0752f9477e
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -500,7 +500,11 @@ utils::escapeBlacklistedHtml(const QString &rawStr)
attrStart = consumeSpaces(attrEnd); attrStart = consumeSpaces(attrEnd);
if (attrStart < attrsEnd) { if (attrName.isEmpty()) {
buffer.append(QUrl::toPercentEncoding(QString(QByteArray(attrStart, 1))));
attrStart++;
continue;
} else if (attrStart < attrsEnd) {
if (*attrStart == '=') { if (*attrStart == '=') {
attrStart = consumeSpaces(attrStart + 1); attrStart = consumeSpaces(attrStart + 1);