From: <sk...@us...> - 2010-09-23 11:48:04
|
Revision: 2389 http://linuxconsole.svn.sourceforge.net/linuxconsole/?rev=2389&view=rev Author: skitt Date: 2010-09-23 11:47:58 +0000 (Thu, 23 Sep 2010) Log Message: ----------- Fix the buffer size passed to the EVIOCGBIT ioctl; patch provided by Sebastian Siewior, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499414 and http://userweb.kernel.org/~dtor/eviocgbit-bug.html Modified Paths: -------------- trunk/utils/evtest.c Modified: trunk/utils/evtest.c =================================================================== --- trunk/utils/evtest.c 2010-09-23 11:46:42 UTC (rev 2388) +++ trunk/utils/evtest.c 2010-09-23 11:47:58 UTC (rev 2389) @@ -333,14 +333,14 @@ printf("Input device name: \"%s\"\n", name); memset(bit, 0, sizeof(bit)); - ioctl(fd, EVIOCGBIT(0, EV_MAX), bit[0]); + ioctl(fd, EVIOCGBIT(0, sizeof(bit[0])), bit[0]); printf("Supported events:\n"); for (i = 0; i < EV_MAX; i++) if (test_bit(i, bit[0])) { printf(" Event type %d (%s)\n", i, events[i] ? events[i] : "?"); if (!i) continue; - ioctl(fd, EVIOCGBIT(i, KEY_MAX), bit[i]); + ioctl(fd, EVIOCGBIT(i, sizeof(bit[0])), bit[i]); for (j = 0; j < KEY_MAX; j++) if (test_bit(j, bit[i])) { printf(" Event code %d (%s)\n", j, names[i] ? (names[i][j] ? names[i][j] : "?") : "?"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |