usb: fastboot: fix potential buffer overflow
authorJeroen Hofstee <jeroen@myspectrum.nl>
Fri, 13 Jun 2014 22:57:14 +0000 (00:57 +0200)
committerMarek Vasut <marex@denx.de>
Wed, 25 Jun 2014 20:44:40 +0000 (22:44 +0200)
commit29425be49bf301b55807dd27f55678e6d0a81060
tree7522de18aa885aaf1cfdb6d5bb525ac0b800ba5c
parent25d1936a192ac62b8df5dc33e37455dcaeb19fae
usb: fastboot: fix potential buffer overflow

cb_getvar tries to prevent overflowing the response buffer
by using strncat. But strncat takes the number of data bytes
copied as a limit not the total buffer length so it can still
overflow. Pass the correct value instead.

cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
cc: Rob Herring <robh@kernel.org>
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
drivers/usb/gadget/f_fastboot.c