Fix duplication/dropping of messages in certain instances.
authorJason Lynch <jason@calindora.com>
Tue, 5 Feb 2013 14:48:37 +0000 (08:48 -0600)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 6 Mar 2013 18:58:59 +0000 (19:58 +0100)
When multiple messages are processed at once, if one of the messages is flagged
for redirection, the wrong array is accessed, potentially causing the redirected
message to be dropped and another message to be duplicated.

src/core/coresession.cpp

index 9b1395b..d7a330a 100644 (file)
@@ -350,7 +350,7 @@ void CoreSession::processMessages()
 
         // recheck if there exists a buffer to store a redirected message in
         for (int i = 0; i < redirectedMessages.count(); i++) {
-            const RawMessage &rawMsg = _messageQueue.at(i);
+            const RawMessage &rawMsg = redirectedMessages.at(i);
             if (bufferInfoCache.contains(rawMsg.networkId) && bufferInfoCache[rawMsg.networkId].contains(rawMsg.target)) {
                 bufferInfo = bufferInfoCache[rawMsg.networkId][rawMsg.target];
             }