Signed-off-by: Michal Srb <m...@suse.com> --- src/XIGrabDevice.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/XIGrabDevice.c b/src/XIGrabDevice.c index a8c5697..4ba91eb 100644 --- a/src/XIGrabDevice.c +++ b/src/XIGrabDevice.c @@ -53,14 +53,21 @@ XIGrabDevice(Display* dpy, int deviceid, Window grab_window, Time time, if (mask->mask_len > INT_MAX - 3 || (mask->mask_len + 3)/4 >= 0xffff) + { + UnlockDisplay(dpy); + SyncHandle(); return BadValue; + } /* mask->mask_len is in bytes, but we need 4-byte units on the wire, * and they need to be padded with 0 */ len = (mask->mask_len + 3)/4; buff = calloc(4, len); - if (!buff) + if (!buff) { + UnlockDisplay(dpy); + SyncHandle(); return BadAlloc; + } GetReq(XIGrabDevice, req); req->reqType = extinfo->codes->major_opcode; -- 1.8.4.5 _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel