projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5aefc9b
)
Fix core crash
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 8 Sep 2011 18:56:32 +0000
(20:56 +0200)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 8 Sep 2011 18:56:32 +0000
(20:56 +0200)
Some CTCP requests triggered a bug in the parser; this fixes the issue.
src/core/ctcpparser.cpp
patch
|
blob
|
history
diff --git
a/src/core/ctcpparser.cpp
b/src/core/ctcpparser.cpp
index
f4177c6
..
b9dc240
100644
(file)
--- a/
src/core/ctcpparser.cpp
+++ b/
src/core/ctcpparser.cpp
@@
-250,13
+250,10
@@
void CtcpParser::packedReply(CoreNetwork *net, const QString &bufname, const QLi
answerSize += replies.at(i).size();
}
- QByteArray quotedReply(answerSize, 0);
- int nextPos = 0;
- QByteArray &reply = quotedReply;
+ QByteArray quotedReply;
+ quotedReply.reserve(answerSize);
for(int i = 0; i < replies.count(); i++) {
- reply = replies.at(i);
- quotedReply.replace(nextPos, reply.size(), reply);
- nextPos += reply.size();
+ quotedReply.append(replies.at(i));
}
params << net->serverEncode(bufname) << quotedReply;