From 165f9097a57d5c1e4a8e0972e17277be66cf8f8e Mon Sep 17 00:00:00 2001 From: David96 Date: Sat, 8 Jan 2022 19:33:19 +0100 Subject: [PATCH] commands/move: Fix crash when pos_y is omitted Fixes #6737 --- sway/commands/move.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sway/commands/move.c b/sway/commands/move.c index f2702fa175..a5f0c1e14d 100644 --- 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 < 2) { + 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);