We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d94a8ca commit 7c58446Copy full SHA for 7c58446
drivers/input/mouse/elantech.c
@@ -1575,7 +1575,13 @@ static const struct dmi_system_id no_hw_res_dmi_table[] = {
1575
*/
1576
static int elantech_change_report_id(struct psmouse *psmouse)
1577
{
1578
- unsigned char param[2] = { 0x10, 0x03 };
+ /*
1579
+ * NOTE: the code is expecting to receive param[] as an array of 3
1580
+ * items (see __ps2_command()), even if in this case only 2 are
1581
+ * actually needed. Make sure the array size is 3 to avoid potential
1582
+ * stack out-of-bound accesses.
1583
+ */
1584
+ unsigned char param[3] = { 0x10, 0x03 };
1585
1586
if (elantech_write_reg_params(psmouse, 0x7, param) ||
1587
elantech_read_reg_params(psmouse, 0x7, param) ||
0 commit comments