sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 01b5350bdcbe5c26f94f5fff9d72da955f56d7b3
parent f33dcd4c604fa24058f6cbaf692831420dc5db67
Author: Simon Ser <contact@emersion.fr>
Date:   Tue,  5 Nov 2019 18:31:41 +0100

Fix segfault in set_mode

best is NULL prior to being assigned to a mode.

Closes: https://github.com/swaywm/sway/issues/4705
Fixes: f33dcd4c604f ("Prefer higher refresh rate default modes")

Diffstat:
Msway/config/output.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sway/config/output.c b/sway/config/output.c @@ -222,7 +222,9 @@ static bool set_mode(struct wlr_output *output, int width, int height, best = mode; break; } - best = mode->refresh > best->refresh ? mode : best; + if (best == NULL || mode->refresh > best->refresh) { + best = mode; + } } } if (!best) {