diff --git a/src/xkb/XKBExtDev.c b/src/xkb/XKBExtDev.c index a3e671df..162cc356 100644 --- a/src/xkb/XKBExtDev.c +++ b/src/xkb/XKBExtDev.c @@ -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);