From e5688ecea38d7a4247d0cd50d7ce290f1d810c2b Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Sat, 22 Feb 2020 14:48:59 +0100 Subject: Fix crashing on Nexus descriptions that are missing BBCode closing brackets. --- src/bbcode.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/bbcode.cpp') 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; -- cgit v1.3.1