diff options
author | John Keeping <john@metanate.com> | 2016-09-19 10:59:40 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2017-08-21 11:31:10 +0200 |
commit | 7715dea48b5d17f6394d1a02c60a84278df71391 (patch) | |
tree | 87d0951d3ca38dfa6ef2fe63761d29b632193c59 /drivers/usb/gadget/f_fastboot.c | |
parent | d331084298002e5cc0a54abb5855be1fc69153c3 (diff) |
fastboot: avoid printing invalid data
There is no guarantee that commands are null-terminated in the USB
request buffer, so limit the length of data that is printed.
Signed-off-by: John Keeping <john@metanate.com>
Tested-by: Steve Rae <steve.rae@raedomain.com>
Diffstat (limited to 'drivers/usb/gadget/f_fastboot.c')
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index aecee7ff38..199621d9f5 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -718,7 +718,7 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req) } if (!func_cb) { - error("unknown command: %s", cmdbuf); + error("unknown command: %.*s", req->actual, cmdbuf); fastboot_tx_write_str("FAILunknown command"); } else { if (req->actual < req->length) { |