Skip to content

Fix bans by remote admins corrupting banlist

Hanicef requested to merge Hanicef/SRB2:fix-ban-corruption into next

if a remote admin bans a player, the banlist ends up corrupted. this is caused by a use-after-init inside the server-side ban logic, where the ban message has not been extracted yet from the network packet that contains the ban. as a result, it starts writing bogus data to the ban reason, which can cause binary characters in ban.txt and thus prevent it from loading on next startup.

the fix simply involves moving the persistence logic later in the function to ensure the buffer that contains the reason has been written to, as well passing NULL when no reason was specified.

Merge request reports