From 2f25dab9b75692726fc77a2f0302799f7e7ab802 Mon Sep 17 00:00:00 2001 From: polaris Date: Sat, 31 May 2014 14:41:07 -0400 Subject: [PATCH] Return if the RC4 is 0 --- gamespy/gs_utility.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gamespy/gs_utility.py b/gamespy/gs_utility.py index 2134245..3b5d6a7 100644 --- a/gamespy/gs_utility.py +++ b/gamespy/gs_utility.py @@ -31,6 +31,10 @@ def rc4_encrypt(_key, _data): key = bytearray(_key) data = bytearray(_data) + if len(key) == 0: + # This shouldn't happen but it apparently can on a rare occasion. key should always be set. + return + # Key-scheduling algorithm S = range(0x100)