mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
check for overflows in SV_SetConfigstring and print a warning message when the gs buffer overflows
This commit is contained in:
parent
1bd7614d21
commit
b51ac6eb9a
2 changed files with 8 additions and 0 deletions
|
@ -630,6 +630,10 @@ static void SV_SendClientGameState( client_t* client )
|
|||
|
||||
MSG_WriteLong( &msg, sv.checksumFeed );
|
||||
|
||||
if ( msg.overflowed ) {
|
||||
Com_Printf( "ERROR: gamestate message buffer overflow\n" );
|
||||
}
|
||||
|
||||
SV_SendMessageToClient( &msg, client );
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,10 @@ void SV_SetConfigstring (int index, const char *val) {
|
|||
val = "";
|
||||
}
|
||||
|
||||
if ( strlen(val) >= BIG_INFO_STRING ) {
|
||||
Com_Error( ERR_DROP, "SV_SetConfigstring: CS %d is too long\n", index );
|
||||
}
|
||||
|
||||
// don't bother broadcasting an update if no change
|
||||
if ( !strcmp( val, sv.configstrings[ index ] ) ) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue