bar/wayland: make sure we don't strcmp() a NULL pointer

This commit is contained in:
Daniel Eklöf 2020-07-20 17:29:56 +02:00
parent e38f593acd
commit aa1b3457a1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -447,7 +447,9 @@ xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output)
struct wayland_backend *backend = mon->backend; struct wayland_backend *backend = mon->backend;
struct private *bar = backend->bar->private; 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 */ /* User specified a monitor, and this is one */
backend->monitor = mon; backend->monitor = mon;
backend->scale = mon->scale; backend->scale = mon->scale;