Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37b3451e authored by Vevek Venkatesan's avatar Vevek Venkatesan Committed by Gerrit - the friendly Code Review server
Browse files

input: misc: fix heap overflow issue in hbtp_input.c



Add the boundary check for ABS code before setting ABS params,
to avoid heap overflow.

Change-Id: I6aad9916c92d2f775632406374dbb803063148de
Signed-off-by: default avatarVevek Venkatesan <vevekv@codeaurora.org>
parent c1b67407
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -415,9 +415,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)
		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) {