From 184b82abccfff95b18bed81ded1b5a7e98d2dbd3 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 24 Dec 2008 11:18:01 -0600 Subject: Backed out changeset: ad4f100c0a9d --HG-- branch : trunk --- src/shared/Auth/AuthCrypt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/shared/Auth/AuthCrypt.cpp') diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp index 199e7192537..7941b33ed8c 100644 --- a/src/shared/Auth/AuthCrypt.cpp +++ b/src/shared/Auth/AuthCrypt.cpp @@ -50,8 +50,9 @@ void AuthCrypt::DecryptRecv(uint8 *data, size_t len) void AuthCrypt::EncryptSend(uint8 *data, size_t len) { if (!_initialized) return; + if (len < CRYPTED_SEND_LEN) return; - for (size_t t = 0; t < len; t++) + for (size_t t = 0; t < CRYPTED_SEND_LEN; t++) { _send_i %= _key.size(); uint8 x = (data[t] ^ _key[_send_i]) + _send_j; -- cgit v1.2.3