I'm using a Data Modul EasyTouch USB multitouch controller,
which is issuing a hid report with a size equals to 0. The rsize
value gets set to
536870912 and Linux is crashing in the memset
because the value is too big.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
rsize = ((report->size - 1) >> 3) + 1;
+ if (rsize > HID_MAX_BUFFER_SIZE)
+ rsize = HID_MAX_BUFFER_SIZE;
+
if (csize < rsize) {
dbg_hid("report %d is too short, (%d < %d)\n", report->id,
csize, rsize);