diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-02-27 11:34:47 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-03-06 09:21:02 +1000 |
| commit | 89e7998fee2d3ffc1cf1d0ab7bc129c5224ec598 (patch) | |
| tree | 84696ef0ccab7b165e360e9261a4276ba0fb26c5 /libevdev/libevdev-int.h | |
| parent | 2e06aed955f55f704b14c265391dc2ce418b8e9f (diff) | |
| download | libevdev-89e7998fee2d3ffc1cf1d0ab7bc129c5224ec598.tar.gz | |
Dynamically allocate the slot values
Instead of relying on a static MAX_SLOTS array, allocated it based on the
number of slots we have on the device. The previous checks for MAX_SLOTS were
incomplete, causing out-of-bound reads.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'libevdev/libevdev-int.h')
| -rw-r--r-- | libevdev/libevdev-int.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h index 847fe56..42141ca 100644 --- a/libevdev/libevdev-int.h +++ b/libevdev/libevdev-int.h @@ -95,7 +95,7 @@ struct libevdev { unsigned long led_values[NLONGS(LED_CNT)]; unsigned long sw_values[NLONGS(SW_CNT)]; struct input_absinfo abs_info[ABS_CNT]; - int mt_slot_vals[MAX_SLOTS][ABS_MT_CNT]; + int *mt_slot_vals; /* [num_slots * ABS_MT_CNT] */ int num_slots; /**< valid slots in mt_slot_vals */ int current_slot; int rep_values[REP_CNT]; |
