sway/commands: Handle incorrect resize unit

problem: an invalid usage of the command resize set will cause sway to crash because it doesn't check for an invalid height.
solution: validate height along with width.
This commit is contained in:
Furkan Sahin 2025-04-24 15:41:20 -04:00 committed by myrslint
parent 75b6c174c9
commit 9cc30afe3c

View file

@ -457,7 +457,7 @@ static struct cmd_results *cmd_resize_set(int argc, char **argv) {
if (argc > num_consumed_args) {
return cmd_results_new(CMD_INVALID, "%s", usage);
}
if (width.unit == MOVEMENT_UNIT_INVALID) {
if (height.unit == MOVEMENT_UNIT_INVALID) {
return cmd_results_new(CMD_INVALID, "%s", usage);
}
}