mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-05-26 21:37:59 -04:00
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:
parent
9d6c9e8783
commit
851cdd0089
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue