mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
fixed demo playback crashing when delta entities/players had an invalid field count
This commit is contained in:
parent
4fcf0f410e
commit
eaa376a292
2 changed files with 8 additions and 0 deletions
|
@ -10,6 +10,8 @@ chg: on Windows, a fatal error will move the early console window to the foregro
|
||||||
chg: com_hunkMegs doesn't have a maximum value anymore
|
chg: com_hunkMegs doesn't have a maximum value anymore
|
||||||
a value too high would reset it and the engine might fail to load with the default value
|
a value too high would reset it and the engine might fail to load with the default value
|
||||||
|
|
||||||
|
fix: demo playback would crash when delta entities/players had an invalid field count
|
||||||
|
|
||||||
fix: strcpy calls with overlapping buffers (undefined behavior), which were responsible for the
|
fix: strcpy calls with overlapping buffers (undefined behavior), which were responsible for the
|
||||||
"chars.h not found" / "couldn't load any skills" issue preventing bots from being added
|
"chars.h not found" / "couldn't load any skills" issue preventing bots from being added
|
||||||
|
|
||||||
|
|
|
@ -789,6 +789,9 @@ void MSG_ReadDeltaEntity( msg_t* msg, const entityState_t* from, entityState_t*
|
||||||
}
|
}
|
||||||
|
|
||||||
lc = MSG_ReadByte(msg);
|
lc = MSG_ReadByte(msg);
|
||||||
|
if ( lc < 0 || lc > ARRAY_LEN(entityStateFields) ) {
|
||||||
|
Com_Error( ERR_DROP, "invalid entityState_t field count %d (max: %d)\n", lc, ARRAY_LEN(entityStateFields) );
|
||||||
|
}
|
||||||
|
|
||||||
// shownet 2/3 will interleave with other printed info, -1 will
|
// shownet 2/3 will interleave with other printed info, -1 will
|
||||||
// just print the delta records
|
// just print the delta records
|
||||||
|
@ -1110,6 +1113,9 @@ void MSG_ReadDeltaPlayerstate( msg_t* msg, const playerState_t* from, playerStat
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lc = MSG_ReadByte(msg);
|
lc = MSG_ReadByte(msg);
|
||||||
|
if ( lc < 0 || lc > ARRAY_LEN(playerStateFields) ) {
|
||||||
|
Com_Error( ERR_DROP, "invalid playerState_t field count %d (max: %d)\n", lc, ARRAY_LEN(playerStateFields) );
|
||||||
|
}
|
||||||
|
|
||||||
const netField_t* field;
|
const netField_t* field;
|
||||||
for ( i = 0, field = playerStateFields ; i < lc ; i++, field++ ) {
|
for ( i = 0, field = playerStateFields ; i < lc ; i++, field++ ) {
|
||||||
|
|
Loading…
Reference in a new issue