summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2015-09-24 18:34:43 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2015-09-24 18:34:43 +0200
commitc2aea2aa5a3266d9eec054d83f8fb93afcf6cb99 (patch)
tree5248a44eaa69ac2e55e125141e8350bf5813eb91
parent652bd911aad295ac789df5e512fffb4ccaaff894 (diff)
downloadmanager-c2aea2aa5a3266d9eec054d83f8fb93afcf6cb99.tar.gz
manager-c2aea2aa5a3266d9eec054d83f8fb93afcf6cb99.zip
Flip "mess.length() > QString(CMD_SIGN).length() &&
mess.left(QString(CMD_SIGN).length()) == CMD_SIGN" to avoid a crash when CMD_SIGN is longer than the message
-rw-r--r--src/crsm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crsm.cpp b/src/crsm.cpp
index e53b201..9275066 100644
--- a/src/crsm.cpp
+++ b/src/crsm.cpp
@@ -451,7 +451,7 @@ void CRSM::ircMessageReceived(IrcMessage *message)
{
writeToServer("[IRC]<" + message->nick() + "> " + mess + "\n");
}
- else if(mess.left(QString(CMD_SIGN).length()) == CMD_SIGN && mess.length() > QString(CMD_SIGN).length())
+ else if(mess.length() > QString(CMD_SIGN).length() && mess.left(QString(CMD_SIGN).length()) == CMD_SIGN)
{
QStringList args = mess.right(mess.length() - QString(CMD_SIGN).length()).split(" ", QString::SkipEmptyParts);
QString command = args.first().trimmed();