commit 1bf1d84b7535c3c132240ed7b18414dc6cfe7e8a
parent f92329701b0983ec41fec29d3abc5c751cbe4a28
Author: David96 <david@hameipe.de>
Date: Sat, 8 Jan 2022 19:33:19 +0100
commands/move: Fix crash when pos_y is omitted
Fixes #6737
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/sway/commands/move.c b/sway/commands/move.c
@@ -874,6 +874,10 @@ static struct cmd_results *cmd_move_to_position(int argc, char **argv) {
return cmd_results_new(CMD_INVALID, "Invalid x position specified");
}
+ if (argc < 1) {
+ return cmd_results_new(CMD_FAILURE, expected_position_syntax);
+ }
+
struct movement_amount ly = { .amount = 0, .unit = MOVEMENT_UNIT_INVALID };
// Y direction
num_consumed_args = parse_movement_amount(argc, argv, &ly);