Commit bce1305
HID: core: Correctly handle ReportSize being zero
It appears that a ReportSize value of zero is legal, even if a bit
non-sensical. Most of the HID code seems to handle that gracefully,
except when computing the total size in bytes. When fed as input to
memset, this leads to some funky outcomes.
Detect the corner case and correctly compute the size.
Cc: stable@vger.kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>1 parent b7429ea commit bce1305
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1597 | 1597 | | |
1598 | 1598 | | |
1599 | 1599 | | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
1600 | 1611 | | |
1601 | 1612 | | |
1602 | 1613 | | |
| |||
1609 | 1620 | | |
1610 | 1621 | | |
1611 | 1622 | | |
1612 | | - | |
| 1623 | + | |
1613 | 1624 | | |
1614 | 1625 | | |
1615 | 1626 | | |
| |||
1739 | 1750 | | |
1740 | 1751 | | |
1741 | 1752 | | |
1742 | | - | |
| 1753 | + | |
1743 | 1754 | | |
1744 | 1755 | | |
1745 | 1756 | | |
| |||
0 commit comments