From 851cdd0089004884bd85a95ad21f04009cb5a53a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 21 May 2026 14:10:50 +0200 Subject: [PATCH] xwayland/xwm: fix out-of-bounds strndup() in read_surface_class() We advance the class pointer here, but we forgot to decrease the length. --- xwayland/xwm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 5547ef607..a16585794 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -667,6 +667,7 @@ static void read_surface_class(struct wlr_xwm *xwm, if (len > 0 && instance_len < len) { surface->instance = strndup(class, instance_len); class += instance_len + 1; + len -= instance_len + 1; } else { surface->instance = NULL; }