diff options
author | John Keeping <john@metanate.com> | 2016-09-19 09:59:40 (GMT) |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2017-08-21 09:31:10 (GMT) |
commit | 7715dea48b5d17f6394d1a02c60a84278df71391 (patch) | |
tree | 87d0951d3ca38dfa6ef2fe63761d29b632193c59 /drivers | |
parent | d331084298002e5cc0a54abb5855be1fc69153c3 (diff) | |
download | u-boot-7715dea48b5d17f6394d1a02c60a84278df71391.tar.xz |
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')
-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 aecee7f..199621d 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) { |