Skip to content

Commit 6ef544a

Browse files
committed
Automatically sanitize /botbalance arg
1 parent fa2e334 commit 6ef544a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/src/serveractions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ struct botbalanceaction : serveraction
315315
{
316316
int balance;
317317
void perform() { botbalance = balance; checkai(); /* botbalance changed */ }
318-
bool isvalid() { return balance >= -9999 && balance <= MAXCLIENTS; }
319-
botbalanceaction(int balance) : balance(balance)
318+
bool isvalid() { return true /*balance >= -9999 && balance <= MAXCLIENTS*/; }
319+
botbalanceaction(int balance) : balance(clamp(balance, -9999, MAXCLIENTS))
320320
{
321321
reqcall = roleconf('a');
322322
reqveto = CR_MASTER; // botbalance

0 commit comments

Comments
 (0)