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 e1f5e84 commit 1d72d9fCopy full SHA for 1d72d9f
drivers/input/mouse/elantech.c
@@ -1588,7 +1588,13 @@ static const struct dmi_system_id no_hw_res_dmi_table[] = {
1588
*/
1589
static int elantech_change_report_id(struct psmouse *psmouse)
1590
{
1591
- unsigned char param[2] = { 0x10, 0x03 };
+ /*
1592
+ * NOTE: the code is expecting to receive param[] as an array of 3
1593
+ * items (see __ps2_command()), even if in this case only 2 are
1594
+ * actually needed. Make sure the array size is 3 to avoid potential
1595
+ * stack out-of-bound accesses.
1596
+ */
1597
+ unsigned char param[3] = { 0x10, 0x03 };
1598
1599
if (elantech_write_reg_params(psmouse, 0x7, param) ||
1600
elantech_read_reg_params(psmouse, 0x7, param) ||
0 commit comments