summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-02-22 14:48:59 +0100
committerAL <26797547+Al12rs@users.noreply.github.com>2020-02-22 14:48:59 +0100
commite5688ecea38d7a4247d0cd50d7ce290f1d810c2b (patch)
tree750d1b54188e71bb93f43ac04117a62929d7cd1b
parent6107883829cd55adad7f58121c54af8af6ad4280 (diff)
Fix crashing on Nexus descriptions that are missing BBCode closing brackets.
-rw-r--r--src/bbcode.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bbcode.cpp b/src/bbcode.cpp
index d9b7debd..e56c4ea2 100644
--- a/src/bbcode.cpp
+++ b/src/bbcode.cpp
@@ -246,7 +246,14 @@ QString convertToHTML(const QString &inputParam)
if ((pos < (input.size() - 1)) && (input.at(pos + 1) == '/')) {
// skip invalid end tag
int tagEnd = input.indexOf(']', pos) + 1;
- pos = tagEnd;
+ if (tagEnd == 0) {
+ //no closing tag found
+ //move the pos up one so that the opening bracket is ignored next iteration
+ pos++;
+ }
+ else {
+ pos = tagEnd;
+ }
} else {
// convert the tag and content if necessary
int length = -1;