Created attachment 35047 [details] [review]
fix Atom width
$ xinput list-props 14
Wacom Button Actions (282): "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), "None" (0), X Error of failed request: BadAtom (invalid Atom parameter)
Major opcode of failed request: 17 (X_GetAtomName)
Atom id in failed request: 0x0
Serial number of failed request: 57
Current serial number in output stream: 57
Atoms are packed as 32bit values, and on 64bit systems, this will mean the last atom in the list copies 4 bytes out of xinput's heap after the end of the data buffer. This patch corrects the dereferenced size so that the resulting atom is zero-extended instead of filling the high half with garbage.
note that since the xorg/app/xinput git tree doesn't have it's own bugzilla category, I used Apps/other here.
i'm pretty sure the first hunk isn't needed since Xlib will return long arrays for 32-bit values (even on 64-bit). The conversion is done internally, hence the code should work as-is. the xi2 code looks good though.
you can easily test the above if you change the inputproto.pc file on your machine to announce version 1.5. then run configure again and it'll build without the xi2 bits - using xi1's property requests instead.
I haven't had a chance to test this, but since the xi2 stuff is correct, can we commit it?
Thanks for the patch, committed (in half)
Author: Kees Cook <email@example.com>
Date: Wed Apr 14 21:19:48 2010 -0700
Atoms from XIGetProperty are 32bits (#27657)