summaryrefslogtreecommitdiff
path: root/libevdev/libevdev.h
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2014-02-27 11:36:04 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2014-03-06 09:21:02 +1000
commit2e06aed955f55f704b14c265391dc2ce418b8e9f (patch)
treeeedcedd5948c5a8097e404c996bc349751b793ab /libevdev/libevdev.h
parent5b0b2ae114ef366e3d524236df445f41f575609f (diff)
downloadlibevdev-2e06aed955f55f704b14c265391dc2ce418b8e9f.tar.gz
Don't sync past MAX_SLOTS slots
If a device has more than MAX_SLOTS slots, we'd run out-of-bounds on the sync array. This function is sig-safe, so we can't alloc here, merely limit the access. Reported-by: Jonas Ã…dahl <jadahl@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Diffstat (limited to 'libevdev/libevdev.h')
-rw-r--r--libevdev/libevdev.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
index d019114..b13e746 100644
--- a/libevdev/libevdev.h
+++ b/libevdev/libevdev.h
@@ -693,6 +693,10 @@ enum libevdev_read_status {
* device state delta. This function returns @ref LIBEVDEV_READ_STATUS_SYNC for
* each event part of that delta, until it returns -EAGAIN once all events
* have been synced.
+ * @note The implementation of libevdev limits the maximum number of slots
+ * that can be synched. If your device exceeds the number of slots
+ * (currently 32), slot indices equal and above this maximum are ignored and
+ * their value will not update until the next event in that slot.
*
* If a device needs to be synced by the caller but the caller does not call
* with the @ref LIBEVDEV_READ_FLAG_SYNC flag set, all events from the diff are