From 4412992469540b1d578cb94a5cd4e6e5829812dc 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. (cherry picked from commit 851cdd0089004884bd85a95ad21f04009cb5a53a) --- xwayland/xwm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index a2cc5ef99..c73f5a7f4 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; }