Prevent receiving large data

This commit is contained in:
StyledStrike 2024-06-30 16:34:05 -03:00
parent 859982989b
commit acb09337d2

View File

@ -8,6 +8,7 @@ CLoadout.cache = {}
-- safe guard against spam
CLoadout.cooldown = {}
CLoadout.spamCount = {}
CLoadout.maxLength = 8192
function CLoadout:IsAvailableForPlayer( ply )
if not IsValid( ply ) then
@ -112,6 +113,12 @@ function CLoadout:ReceiveData( len, ply )
return
end
if len > CLoadout.maxLength then
CLoadout.PrintF( "%s <%s> has sent loadout data that was too big!", ply:Nick(), steamId )
return
end
self.cooldown[steamId] = t + 1
self.spamCount[steamId] = 0