Fix crash if topic has a CarriageReturn
authorromibi <romibi@bluewin.ch>
Thu, 16 Jun 2016 22:50:40 +0000 (00:50 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 28 Feb 2018 22:13:09 +0000 (23:13 +0100)
Resolves GH-218.

(cherry picked from commit d3f99ef6bfc13599dcbddc2f84d29351b7a07d87)

src/qtui/topicwidget.cpp

index 95d6284..9c99ece 100644 (file)
@@ -281,6 +281,9 @@ QString TopicWidget::sanitizeTopic(const QString& topic)
     // some unicode characters with a new line, which then triggers
     // a stack overflow later
     QString result(topic);
+#if QT_VERSION >= 0x050000
+    result.replace(QChar::CarriageReturn, " ");
+#endif
     result.replace(QChar::ParagraphSeparator, " ");
     result.replace(QChar::LineSeparator, " ");