From aa1b3457a1248f84b907570563db7f0d57d837f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 20 Jul 2020 17:29:56 +0200 Subject: [PATCH] bar/wayland: make sure we don't strcmp() a NULL pointer --- bar/wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bar/wayland.c b/bar/wayland.c index f87957a..9ac26ba 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -447,7 +447,9 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) struct wayland_backend *backend = mon->backend; struct private *bar = backend->bar->private; - if (bar->monitor != NULL && strcmp(bar->monitor, mon->name) == 0) { + if (bar->monitor != NULL && mon->name != NULL && + strcmp(bar->monitor, mon->name) == 0) + { /* User specified a monitor, and this is one */ backend->monitor = mon; backend->scale = mon->scale;