USB: cdc-wdm: fix buffer overflow
authorOliver Neukum <oneukum@suse.de>
Tue, 12 Mar 2013 13:52:42 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Mar 2013 20:04:58 +0000 (13:04 -0700)
commit5c6142cc0c0e58daff87e26b1fce585397418bc4
tree055d24effa02f6391285cebaebb63ecb107d9d57
parent82eccc247f86010b0936983b6e963ffd5d4c79e1
USB: cdc-wdm: fix buffer overflow

commit c0f5ecee4e741667b2493c742b60b6218d40b3aa upstream.

The buffer for responses must not overflow.
If this would happen, set a flag, drop the data and return
an error after user space has read all remaining data.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/class/cdc-wdm.c