rehlds
rehlds copied to clipboard
Crash with SZ_GetSpace overflow on (Nick)
Recently I added some new features to my server.
I don't know where is the problem, but every 2 days server is crashing with console overflowed with this message: SZ_GetSpace overflow on (Nick) All the time on the same client, 3512 lines of messages.
Yes, it's an overflow on the client. But client isn't dropped and result an overflow on the server (crash).
ReHLDS should add a protection. The client may be kicked when 'X' amount of prints done, that's to prevent server crash.
How to kick client? Is it only possible inside ReHLDS? That's where protection must be applied: https://github.com/dreamstalker/rehlds/blob/master/rehlds/engine/common.cpp#L1241
Maybe change?
Con_Printf("%s: overflow on %s\n", __func__, buffername);
to
Con_NetPrintf("%s: overflow on %s\n", __func__, buffername);
Like in this commit: https://github.com/dreamstalker/rehlds/commit/98db4672cf90f82052888ae5a5c0fb71a7298dce
How to reduce this problem: https://forums.alliedmods.net/showthread.php?t=334122
Well, adding a plugin with Con_Printf hook for block the console print and finally kick the player when too much times printing, seems to be working without crash.
The problem was when the overflow is caused by: netchan -> message. We can't know who is causing this.
So, the only way will be testing the change to Con_NetPrintf.
Anybody to make the pull request?