From c0ea78590025a618d82b8fbe1d962a3a1ee52a34 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sun, 10 Mar 2019 17:54:17 -0500 Subject: [PATCH] Remove unnecessary padding byte from stored challenge answers --- src/d_netcmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2c6d6003..7c7f5690 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3712,7 +3712,7 @@ consvar_t cv_dummyjoinpassword = {"dummyjoinpassword", "", CV_HIDEN|CV_NOSHOWHEL #define NUMJOINCHALLENGES 32 static UINT8 joinpassmd5[MD5_LEN+1]; boolean joinpasswordset = false; -static UINT8 joinpasschallenges[NUMJOINCHALLENGES][MD5_LEN+1]; +static UINT8 joinpasschallenges[NUMJOINCHALLENGES][MD5_LEN]; static tic_t joinpasschallengeson[NUMJOINCHALLENGES]; boolean D_IsJoinPasswordOn(void) @@ -3752,7 +3752,7 @@ boolean D_VerifyJoinPasswordChallenge(UINT8 num, UINT8 *answer) passed = true; // Wipe and reset the challenge so that it can't be tried against again, as a small measure against brute-force attacks. - memset(joinpasschallenges[num], 0x00, MD5_LEN+1); + memset(joinpasschallenges[num], 0x00, MD5_LEN); joinpasschallengeson[num] = 0; return passed; @@ -3787,7 +3787,7 @@ void D_MakeJoinPasswordChallenge(UINT8 *num, UINT8 *question) joinpasschallengeson[(*num)] = I_GetTime(); - memset(question, 0x00, MD5_LEN+1); + memset(question, 0x00, MD5_LEN); for (i = 0; i < MD5_LEN; i++) question[i] = M_RandomByte();