diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-09-27 21:58:24 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-09-28 12:03:04 +0200 |
commit | 8985c2d1d4b297ea9fdc70e79e344bde73356216 (patch) | |
tree | c3440d2e04c4a21611e8eed4167fa6ce019e5c92 /src | |
parent | Bump mtxclient to released version (diff) | |
download | nheko-8985c2d1d4b297ea9fdc70e79e344bde73356216.tar.xz |
Fix infinite loop that can be triggered by some invalid html
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp index 0e193c43..d6c701b0 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -494,7 +494,11 @@ utils::escapeBlacklistedHtml(const QString &rawStr) 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 == '=') { attrStart = consumeSpaces(attrStart + 1); |