summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Aurich <darkrain42@pidgin.im>2009-05-11 00:20:17 +0000
committerPaul Aurich <darkrain42@pidgin.im>2009-05-11 00:20:17 +0000
commit09ff0545035dab7161e8609b6827d5d3ec0d6641 (patch)
tree7ecdb8c07aa20c2500bb72cb4a2e8854f3b20a76
parentcbe33142498daa3e0ffdff06652a9e98ea3b67d4 (diff)
downloadpidgin-09ff0545035dab7161e8609b6827d5d3ec0d6641.tar.gz
*** Plucked rev 2c9a1153 (khc@pidgin.im):
counterpart for ad057b75 in the outgoing side
-rw-r--r--libpurple/protocols/qq/qq_crypt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpurple/protocols/qq/qq_crypt.c b/libpurple/protocols/qq/qq_crypt.c
index f648e02b6b..c6a0914ef4 100644
--- a/libpurple/protocols/qq/qq_crypt.c
+++ b/libpurple/protocols/qq/qq_crypt.c
@@ -163,9 +163,11 @@ static inline void encrypt_out(guint8 *crypted, const gint crypted_len, const gu
c32_prev[0] = crypted32[0]; c32_prev[1] = crypted32[1];
/* set next 64 bits want to crypt*/
- crypted_ptr += 8;
- memcpy(crypted32, crypted_ptr, sizeof(crypted32));
- plain32[0] = crypted32[0] ^ c32_prev[0]; plain32[1] = crypted32[1] ^ c32_prev[1];
+ if (count64 > 0) {
+ crypted_ptr += 8;
+ memcpy(crypted32, crypted_ptr, sizeof(crypted32));
+ plain32[0] = crypted32[0] ^ c32_prev[0]; plain32[1] = crypted32[1] ^ c32_prev[1];
+ }
}
}