Xi: fix use-after-free in DeepCopyPointerClasses

CVE-2023-0494, ZDI-CAN-19596
pull/1/head
matthieu 2023-02-07 06:32:18 +00:00
parent 146dd57114
commit 1322100d79
1 changed files with 3 additions and 1 deletions

View File

@ -619,8 +619,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
memcpy(to->button->xkb_acts, from->button->xkb_acts,
sizeof(XkbAction));
}
else
else {
free(to->button->xkb_acts);
to->button->xkb_acts = NULL;
}
memcpy(to->button->labels, from->button->labels,
from->button->numButtons * sizeof(Atom));