Got_AddPlayer: check that I_GetNodeAddress(node) is non-NULL before using strcpy to copy it to the playeraddress array
This commit is contained in:
parent
97cf90b9af
commit
40566e6926
|
@ -3291,7 +3291,6 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
boolean splitscreenplayer;
|
boolean splitscreenplayer;
|
||||||
boolean rejoined;
|
boolean rejoined;
|
||||||
player_t *newplayer;
|
player_t *newplayer;
|
||||||
char *port;
|
|
||||||
|
|
||||||
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
|
||||||
{
|
{
|
||||||
|
@ -3322,10 +3321,15 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
|
|
||||||
if (server && I_GetNodeAddress)
|
if (server && I_GetNodeAddress)
|
||||||
{
|
{
|
||||||
strcpy(playeraddress[newplayernum], I_GetNodeAddress(node));
|
const char *address = I_GetNodeAddress(node);
|
||||||
port = strchr(playeraddress[newplayernum], ':');
|
char *port = NULL;
|
||||||
if (port)
|
if (address) // MI: fix msvcrt.dll!_mbscat crash?
|
||||||
*port = '\0';
|
{
|
||||||
|
strcpy(playeraddress[newplayernum], address);
|
||||||
|
port = strchr(playeraddress[newplayernum], ':');
|
||||||
|
if (port)
|
||||||
|
*port = '\0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue