changeset 26951:329f5a43b68a

merge of '49bc9af35492c4f9b66f7233c77ec192432a00f0' and '70ee1de1cc79688256a3dd6ac1a519e24c00a12c'
author Paul Aurich <paul@darkrain42.org>
date Mon, 11 May 2009 22:05:00 +0000
parents 9612a2e8db87 (current diff) 4f36ec04181c (diff)
children 92565c8e1e3a d62b94408a00
files
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/qq/qq_crypt.c	Mon May 11 22:03:46 2009 +0000
+++ b/libpurple/protocols/qq/qq_crypt.c	Mon May 11 22:05:00 2009 +0000
@@ -163,9 +163,11 @@
 		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];
+		}
 	}
 }