XkbChangeTypesOfKey: verify newTypesIn is not null before using it

Based on xorg/xserver@97c9e6a713

Fixes: 8ba0ca32 ("Janitor: ansification, make distcheck, compiler warnings.")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/279>
This commit is contained in:
Alan Coopersmith 2025-02-22 11:59:13 -08:00
parent 48a1335cab
commit 88d1a84ca3

View file

@ -682,8 +682,8 @@ XkbChangeTypesOfKey(XkbDescPtr xkb,
int width, nOldGroups, oldWidth, newTypes[XkbNumKbdGroups];
if ((!xkb) || (!XkbKeycodeInRange(xkb, key)) || (!xkb->map) ||
(!xkb->map->types) || ((groups & XkbAllGroupsMask) == 0) ||
(nGroups > XkbNumKbdGroups)) {
(!xkb->map->types) || (!newTypesIn) ||
((groups & XkbAllGroupsMask) == 0) || (nGroups > XkbNumKbdGroups)) {
return BadMatch;
}
if (nGroups == 0) {