diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-12-26 08:58:18 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-26 08:58:18 -0800 |
| commit | b05b377c257c2f8fa5d877a63fd6fee97babe873 (patch) | |
| tree | 72577ae3ca3f75159a668149e27fbe05431d34bc /drivers/input | |
| parent | 16fb7d4abc672039b96f90597cb631eec5f06f19 (diff) | |
| parent | 73b5dafa887a528bdc6ece4f495b8c9f8ae28de8 (diff) | |
Merge "input: misc: fix heap overflow issue in hbtp_input.c"
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/misc/hbtp_input.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/input/misc/hbtp_input.c b/drivers/input/misc/hbtp_input.c index 05cd1edefb7f..1df5d8812991 100644 --- a/drivers/input/misc/hbtp_input.c +++ b/drivers/input/misc/hbtp_input.c @@ -208,9 +208,13 @@ static int hbtp_input_create_input_dev(struct hbtp_input_absinfo *absinfo) input_mt_init_slots(input_dev, HBTP_MAX_FINGER, 0); for (i = 0; i <= ABS_MT_LAST - ABS_MT_FIRST; i++) { abs = absinfo + i; - if (abs->active) - input_set_abs_params(input_dev, abs->code, + if (abs->active) { + if (abs->code >= 0 && abs->code < ABS_CNT) + input_set_abs_params(input_dev, abs->code, abs->minimum, abs->maximum, 0, 0); + else + pr_err("%s: ABS code out of bound\n", __func__); + } } if (hbtp->override_disp_coords) { |
