enforce upper limit on minutes to prevent unix timestamp from overflowing

This commit is contained in:
eeeee 2011-12-14 13:47:49 +01:00
parent 8f5f45c18f
commit 0c16a58563

View file

@ -1444,7 +1444,7 @@ void CServer::ConBan(IConsole::IResult *pResult, void *pUser)
const char *pReason = "No reason given";
if(pResult->NumArguments() > 1)
Minutes = max(0, pResult->GetInteger(1));
Minutes = min(max(0, pResult->GetInteger(1)), 1000000); // todo: fix this in year 2035
if(pResult->NumArguments() > 2)
pReason = pResult->GetString(2);