From d53258c9438007b3ee12bc03eaf1d372140abf66 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 30 Mar 2018 11:51:20 +0100 Subject: [PATCH] EffectCommand: restrict range of values for duration, fixes #2055 --- src/pocketmine/command/defaults/EffectCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/command/defaults/EffectCommand.php b/src/pocketmine/command/defaults/EffectCommand.php index 60fb6972da..732b5713bd 100644 --- a/src/pocketmine/command/defaults/EffectCommand.php +++ b/src/pocketmine/command/defaults/EffectCommand.php @@ -80,7 +80,10 @@ class EffectCommand extends VanillaCommand{ $amplification = 0; if(count($args) >= 3){ - $duration = ((int) $args[2]) * 20; //ticks + if(($d = $this->getBoundedInt($sender, $args[2], 0, INT32_MAX)) === null){ + return false; + } + $duration = $d * 20; //ticks }else{ $duration = null; }