mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
engine: server: avoid unaligned access in pfnMessageEnd
This commit is contained in:
parent
e481c86ba2
commit
375c06400c
@ -2642,6 +2642,7 @@ void GAME_EXPORT pfnMessageEnd( void )
|
|||||||
{
|
{
|
||||||
const char *name = "Unknown";
|
const char *name = "Unknown";
|
||||||
float *org = NULL;
|
float *org = NULL;
|
||||||
|
word realsize;
|
||||||
|
|
||||||
if( svgame.msg_name ) name = svgame.msg_name;
|
if( svgame.msg_name ) name = svgame.msg_name;
|
||||||
if( !svgame.msg_started ) Host_Error( "MessageEnd: called with no active message\n" );
|
if( !svgame.msg_started ) Host_Error( "MessageEnd: called with no active message\n" );
|
||||||
@ -2673,7 +2674,8 @@ void GAME_EXPORT pfnMessageEnd( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(word *)&sv.multicast.pData[svgame.msg_size_index] = svgame.msg_realsize;
|
realsize = svgame.msg_realsize;
|
||||||
|
memcpy( &sv.multicast.pData[svgame.msg_size_index], &realsize, sizeof( realsize ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( svgame.msg[svgame.msg_index].size != -1 )
|
else if( svgame.msg[svgame.msg_index].size != -1 )
|
||||||
@ -2705,7 +2707,8 @@ void GAME_EXPORT pfnMessageEnd( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(word *)&sv.multicast.pData[svgame.msg_size_index] = svgame.msg_realsize;
|
realsize = svgame.msg_realsize;
|
||||||
|
memcpy( &sv.multicast.pData[svgame.msg_size_index], &realsize, sizeof( realsize ));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user