summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-09-27 21:58:24 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-09-27 22:02:41 +0200
commit0752f9477e1beb6cfbcec608b60c6418cd3dccf4 (patch)
tree3b18941f71b58c4be45bfb8e23feaf3b496c3862 /src
parentIf and Else blocks were backwards (diff)
downloadnheko-0752f9477e1beb6cfbcec608b60c6418cd3dccf4.tar.xz
Fix infinite loop that can be triggered by some invalid html
Diffstat (limited to 'src')
-rw-r--r--src/Utils.cpp6
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);