From 338917b1942e42b9a7d650303e49265f9abd334e Mon Sep 17 00:00:00 2001 From: Scoopta Date: Mon, 22 Jan 2024 22:38:44 -0800 Subject: [PATCH] Fixed bug reported in https://github.com/swaywm/sway/issues/7915 --- src/wofi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wofi.c b/src/wofi.c index 9048616..61d1498 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -1745,6 +1745,12 @@ void wofi_init(struct map* _config) { char* height_str = config_get(config, "height", "40%"); width = strtol(width_str, NULL, 10); height = strtol(height_str, NULL, 10); + + if(width > UINT16_MAX || height > UINT16_MAX) { + fprintf(stderr, "Do you actually have a monitor big enough to see this O_o? Dimensions can be no larger than %ux%u\n", UINT16_MAX, UINT16_MAX); + exit(1); + } + x = map_get(config, "x"); y = map_get(config, "y"); bool normal_window = strcmp(config_get(config, "normal_window", "false"), "true") == 0;