From 5d169989b11ce46c6ec3e05eddbc9b6da592dba9 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 20 Apr 2022 02:27:26 +0100 Subject: [PATCH] Avoid int overflow when using fillr in negative coords - default to a depth of "radius" - Fixes #1667 --- .../main/java/com/sk89q/worldedit/command/UtilityCommands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 1037df0b1d..443daba81c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -324,7 +324,7 @@ public int fillr( //FAWE end radius = Math.max(1, radius); we.checkMaxRadius(radius); - depth = depth == null ? Integer.MAX_VALUE : Math.max(1, depth); + depth = depth == null ? (int) radius : Math.max(1, depth); we.checkMaxRadius(radius); BlockVector3 pos = session.getPlacementPosition(actor);