From 43347b56ebdea21e8467c568b1ef38178a7022f3 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 4 Feb 2015 12:24:18 +0000 Subject: [PATCH] Fix check order of keygen_i. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12145 d7cf8633-e32d-0410-b094-e92efae38249 --- crypto.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crypto.c b/crypto.c index 8f7deba7..ebb78d2e 100644 --- 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; } -- 2.39.2