engine: server: fix signed integer overflow in challenge generator

This commit is contained in:
Alibek Omarov 2024-06-09 07:05:24 +03:00
parent 767556ccad
commit df23ddb545
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ static void SV_GetChallenge( netadr_t from )
if( i == MAX_CHALLENGES )
{
// this is the first time this client has asked for a challenge
svs.challenges[oldest].challenge = (COM_RandomLong( 0, 0xFFFF ) << 16) | COM_RandomLong( 0, 0xFFFF );
svs.challenges[oldest].challenge = (COM_RandomLong( 0, 0x7FFF ) << 16) | COM_RandomLong( 0, 0xFFFF );
svs.challenges[oldest].adr = from;
svs.challenges[oldest].time = host.realtime;
svs.challenges[oldest].connected = false;