Bug 23708

Summary: XICheckInvalidMaskBits called with wrong parameters
Product: xorg Reporter: Carlos Garnacho Parro <carlosg>
Component: Input/otherAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: peter.hutterer
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
patch none

Description Carlos Garnacho Parro 2009-09-04 06:35:52 UTC
Created attachment 29214 [details] [review]
patch

AFAICS mask_len is specified in bytes, and XICheckInvalidMaskBits takes the mask_len parameter in bytes as well, so multiplying it by 4 in the callers seems to make the function check random memory, which is likely to have enabled bits.

I'm attaching a patch that makes XI2 grabs not fail with correct masks for me.
Comment 1 Peter Hutterer 2009-09-06 19:27:06 UTC
mask_len is specified in bytes, but only for the libXi interface. the protocol is in 4-byte units. The real issue was in libXi, for XIGrabDevice it calculated the mask len wrong. Pushed as 369600cf37cd884793c4802a56c8355bc1812dc6.

Please verify that this is fixed now and close the bug if it is. Thanks for reporting!
Comment 2 Carlos Garnacho Parro 2009-09-07 10:19:54 UTC
Doh! right, should have checked the wire protocol spec :), your patch indeed  fixes the issue, thanks! closing as FIXED.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.