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-27 22:02:41 +0200 |
commit | 0752f9477e1beb6cfbcec608b60c6418cd3dccf4 (patch) | |
tree | 3b18941f71b58c4be45bfb8e23feaf3b496c3862 /src | |
parent | If and Else blocks were backwards (diff) | |
download | nheko-0752f9477e1beb6cfbcec608b60c6418cd3dccf4.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 d0b6818d..cedf537a 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -500,7 +500,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); |