OSDN Git Service

usb: chipidea: debug: avoid out of bound read
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 28 Apr 2015 17:30:47 +0000 (19:30 +0200)
committerPeter Chen <peter.chen@freescale.com>
Wed, 6 May 2015 06:28:18 +0000 (14:28 +0800)
commitbd5fb0aec3dd7cde7ec4c397b10e55d4c9626d8d
tree207a768da295aac03cdfe4db7bbab0f3f97ea772
parent0d3bba0287d4e284c3ec7d3397e81eec920d5e7e
usb: chipidea: debug: avoid out of bound read

A string written by the user may not be zero terminated.

sscanf may read memory beyond the buffer if no zero byte
is found.

For testing build with CONFIG_USB_CHIPIDEA=y, CONFIG_USB_CHIPIDEA_DEBUG=y.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/debug.c