xwayland/xwm: fix out-of-bounds strndup() in read_surface_class()

We advance the class pointer here, but we forgot to decrease the
length.
This commit is contained in:
Simon Ser 2026-05-21 14:10:50 +02:00 committed by Simon Zeni
parent 9d6c9e8783
commit 851cdd0089

View file

@ -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;
}