]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix check order of keygen_i.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Feb 2015 12:24:18 +0000 (12:24 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Feb 2015 12:24:18 +0000 (12:24 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12145 d7cf8633-e32d-0410-b094-e92efae38249

crypto.c

index 8f7deba70afd34117a06dd1d3464b7d314e494d5..ebb78d2e9b44ecad65877a0eed2bd9c78f37cb07 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -1068,17 +1068,17 @@ static void Crypto_KeyGen_Finished(int code, size_t length_received, unsigned ch
                return;
        }
 
-       if(keygen_i >= MAX_PUBKEYS || !pubkeys[keygen_i])
+       if(keygen_i < 0)
        {
-               Con_Printf("overflow of keygen_i\n");
-               keygen_i = -1;
+               Con_Printf("Unexpected response from keygen server:\n");
+               Com_HexDumpToConsole(buffer, (int)length_received);
                SV_UnlockThreadMutex();
                return;
        }
-       if(keygen_i < 0)
+       if(keygen_i >= MAX_PUBKEYS || !pubkeys[keygen_i])
        {
-               Con_Printf("Unexpected response from keygen server:\n");
-               Com_HexDumpToConsole(buffer, (int)length_received);
+               Con_Printf("overflow of keygen_i\n");
+               keygen_i = -1;
                SV_UnlockThreadMutex();
                return;
        }