projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
multilineedit: handle unterminated mIRC codes
[quassel.git]
/
src
/
uisupport
/
multilineedit.cpp
diff --git
a/src/uisupport/multilineedit.cpp
b/src/uisupport/multilineedit.cpp
index
166e12c
..
a9a2ae2
100644
(file)
--- a/
src/uisupport/multilineedit.cpp
+++ b/
src/uisupport/multilineedit.cpp
@@
-601,6
+601,10
@@
QString MultiLineEdit::convertMircCodesToHtml(const QString& text)
}
posRight = text.indexOf(mircCode.cap(), posRight + 1);
}
posRight = text.indexOf(mircCode.cap(), posRight + 1);
+ if (posRight == -1) {
+ words << text.mid(posLeft);
+ break; // unclosed color code; can't process
+ }
words << text.mid(posLeft, posRight + 1 - posLeft);
posLeft = posRight + 1;
}
words << text.mid(posLeft, posRight + 1 - posLeft);
posLeft = posRight + 1;
}