mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-09 03:48:04 +02:00
Fix _XkbReadGetDeviceInfoReply for nButtons == dev->buttons
XkbGetDeviceInfo(dpy, XkbXI_ButtonActionsMask, 2, 0, 0) always returns
NULL because the number of buttons on the device equals (unsurpisingly)
the number of buttons requested (i.e. first + nBtns == dev->nbuttons).
This currently causes it to bail out and return NULL.
Fixes f293659d5a
This commit is contained in:
parent
0a951047f6
commit
ae3eca18ce
1 changed files with 2 additions and 4 deletions
|
|
@ -188,8 +188,7 @@ _XkbReadGetDeviceInfoReply(Display *dpy,
|
|||
return tmp;
|
||||
}
|
||||
if (rep->nBtnsWanted > 0) {
|
||||
if (((unsigned short) rep->firstBtnWanted + rep->nBtnsWanted)
|
||||
>= devi->num_btns)
|
||||
if (((unsigned short) rep->firstBtnWanted + rep->nBtnsWanted) > devi->num_btns)
|
||||
goto BAILOUT;
|
||||
act = &devi->btn_acts[rep->firstBtnWanted];
|
||||
bzero((char *) act, (rep->nBtnsWanted * sizeof(XkbAction)));
|
||||
|
|
@ -201,8 +200,7 @@ _XkbReadGetDeviceInfoReply(Display *dpy,
|
|||
if (rep->nBtnsRtrn > 0) {
|
||||
int size;
|
||||
|
||||
if (((unsigned short) rep->firstBtnRtrn + rep->nBtnsRtrn)
|
||||
>= devi->num_btns)
|
||||
if (((unsigned short) rep->firstBtnRtrn + rep->nBtnsRtrn) > devi->num_btns)
|
||||
goto BAILOUT;
|
||||
act = &devi->btn_acts[rep->firstBtnRtrn];
|
||||
size = rep->nBtnsRtrn * SIZEOF(xkbActionWireDesc);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue